How would one make a Health Bar decrease if a player is in a specific animation state?

I’ve found many great tutorials on coding health bars but am specifically looking for how to connect a decreasing health bar to an animation state. Basically so that if my player character is in the “working” animation state, their stress meter would rise of fall overtime (using deltatime).

Thanks in advance.

if( anim_Animator.GetCurrentAnimatorStateInfo(0).IsName(“AnimationName”))
health–;