Event: unit becomes attacked
you can add a condition like real - damage taken more than 50.0
actions:
if random number between 1 and 100 equal or less than (10 + level of <dummy ability* for attacking unit>)
pause unit
now depending on more or less pretty coding, use either a wait or start a one-shot timer.
I'll be sloppy now and just use
wait - (level of ability * 0.50) seconds (just a suggestion to modify the bash duration)
unpause triggering unit.
Remember that in a wait you cannot address other units than triggering unit, thus for other abilities a wait is pretty useless.
If you want to have a knockback inbetween, I'd use instead of the suggested wait the following (you'll need a global point variable Loc; nicer would be a local one in jass to ensure MUI, though..):
for loop integer A from 1 to 5, do:
{set Loc = position of triggering unit
unit - move triggering unit instantly 25 with polar offset (unit facing direction -180 degrees)
custom function - call Removlocation (udg_Loc)
wait 0.1 seconds
}
wait (whatever time left until stun is over)
unpause unit
Hope this does it for you.. if you want another angle to hit the unit along, just experiment a bit... (e.g. before loop turn unit instantly facing (angle between attacking unit and attacked unit/triggerung unit)
...
*I'd suggest moon glaive as dummy ability since it really does nothing already
