Within AICastSpell is the following:
Code:
if(!(!tar->IsImmuneToSpell(botSpell.SpellId, this) && tar->CanBuffStack(botSpell.SpellId, botLevel, true) >= 0))
break;
This should prevent that from happening. What mob was it? We'd have to look at exactly what they're immune to, and why that line isn't working correctly, if it isn't.
Maybe the mob was just highly resistant. There is nothing in there to have them not try to slow if they keep getting resisted.