I tried detecting if my unit is stunned with IsUnitType(myUnit, UNIT_TYPE_STUNNED) but it turns out that it doesn't show true if it is stunned. I tried using 'ANbh' (neutral hostile bash) as the stunning ability. So is this function bugged or I'm using it wrong?
So that means I need to detect the buff for each stunning ability? Aww man... its kinda weird since UNIT_TYPE_SNARED actually works fine though. Thanks for the answer anyway :)
Hmm.. I see. But what I'm not sure is the stun buffs for impale, volcano and Cluster rockets. Are they supposed to have their own stun buffs or I can actually use the general stun buff?
EDIT: oh and just to share what I have found, the UNIT_TYPE_SNARED and UNIT_TYPE_SLEEPING actually works as how they should be. And "SNARED" includes entangling roots, ensnare and web spells.