Instead of this:
set bj_lastCreatedEffect = AddSpecialEffectTarget(udg_FF_SFX, udg_FF_NearbyUnits[udg_FF_Index], udg_FF_Attachment)
Custom script: call DestroyEffect(bj_lastCreatedEffect)
you could use this:
call DestroyEffect(AddSpecialEffectTarget(udg_FF_SFX, udg_FF_NearbyUnits[udg_FF_Index], udg_FF_Attachment))
Instead of creating so many tree remover,just create a peasant at the start of the game,hide it,cache it,add locust to it.
Skip remaining actions
You can remove this one because it just skips nothing
You could add the unit type of the field to the dummy remover
Move the removelocation loc2 inside the pick unit block,cause you are leaking ( number of units in that group - 1) positions every 0.03 seconds.
Unit groups are just like integer loops,as you can see,when you put this integer or variable:
set count = count + 1
The group is picking the units,then applying actions to it.This is the same to integers thats why you leak locations.
In short,unit groups are loops
Dont use unit in the condition of the dummy remover,use unittype instead
You could also make this a channeling spell
You should read this,then this spell will be approved