Yanfly Battle Engine + Casting animation help

Alrighty, I has me a little problem that I have been able to identify but I'm not a scripting wiz like some of you guys. But hear me out. 

Basically, I'm using Theolized Battle System with the addition of the Casting Pose. There is a slight problem with the two and the yanfly battle engine. 
Whenever an enemy is getting ready to cast a spell, and I attempt to run away from battle it gives me a nomethoderror. And I figured it is because of the casting pose animation is interfering with this, because I tried it against a enemy who isn't casting a spell, and it works fine.

The code is here in the Battle Engine+


Between 1658 and 1662


def sprite
return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
end

end # Game_Enemy


And all I'm trying to do is just make it so it doesn't crash when I have my heroes trying to run while an enemy is casting a spell that requires a battle animation to loop over on the enemy. I'm completely stumped on how to fix this issue. Any help would be great. Thanks.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-battle-engine-casting-animation-help.72196/