Simple, since you use hashtables:
-
Trigger
-
Events
-

Unit - A unit starts the effect of an ability
-
Conditions
-
Actions
-

Custom script: local group g = CreateGroup()
-

//Dummy creation and stuff
-

Unit Group - Add (Last created unit) to TempGroup //Last created unit refers to the dummy missile.
-

Custom script: call SaveGroupHandle (udg_Hash, GetHandleId (GetLastCreatedUnit()), StringHash("group"), g)
-

Trigger - Turn on (Trigger2 <gen>)
-

Custom script: set g = null
-
Trigger2
-
Events
-

Time - Every 0.03 seconds of game-time
-
Conditions
-
Actions
-

If (All conditions are true) then do (Actions) else do (Actions)
-


If - Conditions
-



(TempGroup is empty) Equal to True
-


Then - Actions
-



Trigger - Turn off (This trigger)
-


Else - Actions
-



Unit Group - Pick every unit in TempGroup and do (Actions)
-




Loop - Actions
-





Set Points[1] = (Position of (Picked unit))
-





Set Unit = (Picked unit)
-





Set UnitHandle = (Picked unit)
-





Set TempGroup2 = (Units within 150.00 of Points[1] matching (((Matching unit) is in (Load Key(group) of (Key(Picked unit)) in Hash) Equal to False) and ((Matching unit) belongs to an enemy of (Owner of (Picked unit)) Equal to True)
-





Unit Group - Pick every unit in TempGroup2 and do (Actions)
-






Loop - Actions
-







Unit Group - Add (Picked unit) to (Load Key(group) of (Key(UnitHandle)) in Hash)
-







Unit - Cause Unit to damage (Picked unit) dealing 100.00 damage of Attack type Spells and Damage type Normal
-





Custom script: call RemoveLocation (udg_Points[1])
-





Custom script: call DestroyGroup (udg_TempGroup2)
NOTE: The trigger above is not the full trigger of how it should look like, I am just emphasizing how you are going to work with that local group we created in the first trigger. Finally, when you have the condition (Distance between Points) to check when you are going to kill the missile unit, destroy the group: call DestroyGroup (LoadGroupHandle (udg_Hash, GetHandleId (GetEnumUnit()), StringHash("group"))).
Unit is a Unit variable, while UnitHandle is a Handle variable.