Keep in mind I am not a programmer and know shit about coding: But playing various custom maps (Special Forces was one I think that had it) I have found some units (Usually a Ghost) which gets a "Passive Cloak" thing. How it works being that after 2-5 seconds or so of not attacking or using an ability the unit itself cloaks. And the cloak is broken when the unit attacks or uses a special ability. So I'd think having a mechanic triggering off that. Some slight of hand using the code to establish an effect when not attacking/using abilities, give it a 1 minute "build time" or something. Have a cancel on that mechanic that is related to attacking or using an ability. When build time is finished, cures Madness. So there is a basis for the ability triggers out there. It can be done I'd think. I don't know if you can rip into an old version of their map and extract the bit of code for it though to see how they set the trigger for that Passive Cloak.