I used Attacking unit as the unit but it would depend on you because on my full trigger if the unit is attacked and Attacked unit equals to my unit then I ordered the Attacking unit to cast various spell through issuing a command like this, it would be best to store Attacking Unit most likely if it is used twice:
-
Unit - Order (Attacked unit) to Orc Tauren Chieftain - War Stomp
An example is this, make your unit cast the spell by finding out your custom spells'
Order String - Use/Turn On.
So for example, if your custom spell has a Order String of Shockwave then what you must do is Order your unit to use Shockwave and thus changing it to this:
-
Unit - Order (Attacked unit) to Orc Tauren Chieftain - Shockwave (Attacking Unit)
This is a way in GUI and you must remember that each sets of abilities are divided into target, point targets, or no targets.
Some notes as well, you should base your custom spells' Order String to the same target type of spell you have like for example, you made a custom spell based on War Stomp which is an Instant spell. So you should based it on Order String of an Instant spell as well like War Stomp obviously or if it has been used already then Thunder Clap and more..
This is to avoid confusion and to keep it clean.