How to make character Temporarily Invincible when hit?

I’m making a Megaman style game for my game design class, and I’m having issues with making my character temporarily invincible when he’s hit. I’ve attached the battle system I made for reference.