Creature AI - Invisibility

hi again,

In my mod for some time now when enemies/creatures cast improved invisibility/invisibility they stop attacking, I am hoping someone can help me figure out why.

I have not made any edits to the spell, many creatures in the mod have a custom ondeath script but besides that all scripts are defaults.

I’ve resorted to just removing the spell from all creatures… but would be cool if someone could help me fix this.