The AI will switch if it cannot deal and damage whatsoever. I may be missing something in your post Chinese Dood however. Say you have a Dark-type against Caitlin's Musharna. Musharna has nothing that can hit say, an Umbreon, therefore Caitlin will switch out. Even though this is the E4, the same thing applies to the Battle Subway.