For questions like these you can check out the new Skibi TD from Blizzard, since it is unprotected.
First you give a tower the spell and mana. Make sure it has an attack and that you remember the order string to activate the spell.
Next, before making the actual trigger, create a point type variable with no initial value. Let's call it location.
For example, let's use a tower called Fire Tower that has a flamestrike-based spell, and that the enemy units belong to player 12.
Events: Unit - A unit owned by player 12 (Brown) Is attacked
Conditions: (Unit-type of (Attacking unit)) Equal to Fire Tower
Actions: Set location = (Position of (Attacked unit))
Unit - Order (Attacking unit) to Human Blood Mage - Flame Strike location
Custom script: call RemoveLocation( udg_TempPoint )
Just give credit to Skibi if you use this kind of trigger.