The battle code is all located within Scene_Battle_1 - Scene_Battle_4, Game_Battler_1 - Game_Battler_3, Game_BattleAction, and Game_Enemy. The scripts are divided into sections (see the comments), so you should be able to find what bits do what.
Game_Enemy is where the enemy picks an action to use, and Scene_Battle_4 is where the enemy is told to do it.