Instead of picking every unit in the map, you can add all Assassin-type units into a global group when they enter play, are trained, sold, summoned, etc. This way when you get to your periodic trigger, it won't be so taxing.
-
Group Assassin
-

Events
-


Unit - A unit enters (Playable map area)
-

Conditions
-


(Unit-type of (Triggering unit)) Equal to Grand Assassin
-

Actions
-


Unit Group - Add (Triggering unit) to GroupAssassin
We'll leave out your destructable loop for the moment since it doesn't do anything. As for your five If-Then-Else statements at the end, you could use a loop with the 'nmbr' variable and only one ITE statement instead. See below.
-
Periodic Check
-

Events
-


Time - Every 1.00 seconds of game time
-

Conditions
-

Actions
-


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



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






((Picked unit) has buff Stealth) Equal to True
-





Then - Actions
-






Set Stealth[(Player number of (Owner of (Picked unit)))] = 1
-





Else - Actions
-






Set Stealth[(Player number of (Owner of (Picked unit)))] = 0
-


For each (Integer Nmbr) from 1 to 5, do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






TreantSec[Nmbr] Greater than 0
-





Then - Actions
-






Set TreantSec[Nmbr] = (TreantSec[Nmbr] - 1)
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








TreantSec[Nmbr] Less than or equal to 0
-







Then - Actions
-








Unit - Change ownership of Treant[Nmbr] to Neutral Passive and Retain color
-







Else - Actions
-





Else - Actions
Same as the above trigger, you can use a loop to order the treants to move in their respective regions using both a unit array and a region array. Also, you need to set the point to a variable to clear the leak afterwards.
-
Treant Move
-

Events
-


Time - Every 8.00 seconds of game time
-

Conditions
-

Actions
-


For each (Integer Nmbr) from 1 to 5, do (Actions)
-



Loop - Actions
-




Set TempLoc = (Random point in TreantRegion[Nmbr])
-




Unit - Order Treant[Nmbr] to Move To TempLocation
-




Custom script: call RemoveLocation( udg_TempLoc )
This is just setting the treants and their regions into arrays so that they can be used in the loops above.
-
Treant Store
-

Events
-

Conditions
-

Actions
-


Set Treant[1] = Treant 0001 <gen>
-


Set Treant[2] = Treant 0002 <gen>
-


Set Treant[3] = Treant 0003 <gen>
-


Set Treant[4] = Treant 0004 <gen>
-


Set Treant[5] = Treant 0005 <gen>
-


Set TreantRegion[1] = Treant 1 <gen>
-


Set TreantRegion[2] = Treant 2 <gen>
-


Set TreantRegion[3] = Treant 3 <gen>
-


Set TreantRegion[4] = Treant 4 <gen>
-


Set TreantRegion[5] = Treant 5 <gen>