How do I make it so doing an action overrides the effects of another condition

The top bit of code is responsible for inflicting damage on an enemy when a button is pressed while the player is colliding with the enemy. The bottom bit of code is my attempt to make it so the player takes damage when they collide with the enemy without having pressed the button.

But the bottom bit of code cancels out the top bit and makes it so the player is damaged regardless of what button is pressed.

Set the 2 bottom blocks of ATTACK TIMER as subevent, like you did for DAMAGE TAKING.