States are not actions, in your game they would control how the character is updated (e.g. each state could have its own update() function).
Take a look at the diagram on this page:
The states tell us something about the world (the door is open or closed).
The actions show us what takes the world from one state to another.
In your case you could have states like:
- in pain
And the transition between states (the events / arrows between states) would be player inputs and reactions to the world, such as:
- hit by monster
- jump button pressed
- shoot button pressed
Each state needs to check if any relevant events have occurred. Typically this is done with if statements.
But what happen when you are running
when you take damage?
hit by monster event would be triggered and transition the player into the
in pain state.
or jumping taking damage and shooting
at the same time?
The player would transition into the
in pain state again which is where you could display your "hit" sprite that shows the character falling backwards.
You probably aren't going to escape if statements, but you can avoid deeply nested statements.