Ok, so the math here is inconsistent/ incorrect. The round before the last, Mudkip had 74 HP. The damage should be 10 for Night Shade, 4 for Confusion hit, 2 for burn damage for an action, and 9.5 from Psychic, so that should be at 48 HP. After that, there should be 12 from thunder punch, 2 for burn after foresight and 10 for night shade, so that should be 24 HP.