You can press X on the top in trigger editor which allows you to make variables. As I stated, both variables are point variables, which you should be making to determine the positions of both units. I named one Caster and one Target, but you can use something like TempPoint1 and TempPoint2, whichever tickles your fancy.
If you want to set a variable, you need to use an action called Set Variable, which then you add the triggering unit to the caster and the target being targeted by a spell to the target variables. Then use custom scripts to destroy the point leaks after check.