Set boolean to false when animation changes?

I have an animation event on a boss that occasionally glitches. I have it so that when the player swipes a certain direction while the boss is attacking, the “Hurt” boolean is set to true and the boss takes damage. However if the player hits the boss multiple times the Hurt boolean sometimes stays true, making the boss take damage again without the player doing anything. Is there a way to set the Hurt boolean to false again after the animation finishes and transitions to another?

If you’re using Animator:

for check if animation change, you may check CurrentAnimatorStateInfo

However, this method can’t check for animation looping. (you may use for this normalizedtime)

For a better help, post more info