You can't hurt him when he attacks anyways. You just dive down here to avoid attacks just before he makes them, and wait it out until you can attack. This is especially exploitable during pinch, in which you have to wait for him to attack with the missiles, so you can just sit tight until after he does the slime attack.