I'm running a mod which provides several companion NPCs who are scripted to follow me and fight my enemies. I've discovered that if I change cells (by teleport spell or going through a door) in the middle of a fight, my companion(s) arrive in the new cell in a frozen state. They don't walk with me or show any animation at all, even though their AI package is set to Follow (I checked that with the console). It's as if their AI routine either halted or crashed.
When I see a companion in this state, I can fix it by opening the console and typing StartCombat Player, followed by StopCombat; I guess this restarts the AI. What I'd like to know is, is there a script command which will detect if an AI package has halted, so that this problem can be checked and fixed automatically in a script?