I didn't want to post this in the battle, but you've been rounding HP wrong. Leave it in decimal form until the end of the round, and then round up unless the Pokemon has 0.5 HP or less, in which case it faints. This would cause Joy to have 55 HP, not 54.