This is very simple to do first change the permanente invisible skill duration or cooldown to 0, then create a veraible at the point when you cast the spell(example: like a position of triggering unit when using a dummy warstomp or point being cast like say a dummy monsoon)
Then crate a unit group variable add all units in range of the point to the group( for allies make a condition saying mathcing unit equal to an ally of ouwner of triggering unit.)
Then add the permante invisable skill to the picked unit, then say after whater time, pick all unit in unit group(whatever) and remove permanente invisible from the picked unit.
I'm not at my comp with War3 so i can't test this but it should work