Have a look at the CanCharge (unnamed) - validator for reference. It "returns" true, whenever a unit is using the attack ability. Its of Unit Order Target- Type and lets you pick a specific ability.
Disable-validators for behaviors need to be true for the behavior to work, if they are false, the behavior is disabled.
Just got an idea for a no-trigger solution: Give the unit the behavior to stun or stop itself when damaged right away and add a disable-validator, which checks, if the current order of the unit is the desired spell. Basically the buff is always disabled and only active when casting the spell. Would fix the remove-when-cancel thing as well.
Still your best bet, though... you could add a behavior to the casting unit for the cast duration. In this buff you modify the damage response to apply a 0.01 sec stun buff (or buff, which just disables the casting ability) on the source unit. An issue Stop Order effect should work as well.
Have a look at the CanCharge (unnamed) - validator for reference. It "returns" true, whenever a unit is using the attack ability. Its of Unit Order Target- Type and lets you pick a specific ability.
Disable-validators for behaviors need to be true for the behavior to work, if they are false, the behavior is disabled.
Just got an idea for a no-trigger solution: Give the unit the behavior to stun or stop itself when damaged right away and add a disable-validator, which checks, if the current order of the unit is the desired spell. Basically the buff is always disabled and only active when casting the spell. Would fix the remove-when-cancel thing as well.
little off-topic? ;)
Add the ability to the unit, open command card, add a button, select ability command, select desired ability. Not that hard :D
make a remove validator which checks for the current order or something.
Still your best bet, though... you could add a behavior to the casting unit for the cast duration. In this buff you modify the damage response to apply a 0.01 sec stun buff (or buff, which just disables the casting ability) on the source unit. An issue Stop Order effect should work as well.