I don't know if it will work. *untested*
But if you could also try going into Game_Enemy, finding this line -
self.current_action.decide_random_target_for_enemy
and replacing it with this -
loop do
self.current_action.decide_random_target_for_enemy
unless game_party.actors[self.current_action.target_index].state?(state_id)
break
end
end
Replacing state_id with the id of the state of course.
Nouman's idea is much easier and will probably work. I'm just bored.