you can add a random int between 0 and 100 to choose to play an animation automatically if the random number is below 17 (does that give 17% chance?)
Where do you plug that in?
Do you want to play that animation on your player character when taking damage?
Then do it like that: