Okay, so, this is a bit of a weird one. Say a Pokemon has an ability like Volt Absorb, where they aren't hurt by a move of a specific type but actually gain HP from it if they have lost any. If this Pokemon gets confused, uses a move that matches with the type of that ability, and hits itself because of confusion. Would the user recover HP because the move matches up with the ability, or would they still lose HP?
Apologies if this has been asked before, I tried looking for it and couldn't find anything that matched up with it.