Paper Mario Style combat

Hey all,

I was wonder what certain details go into creating a combat system equivalent to the ones found in paper mario where you have your typical menu choose to attack but with the added capabilities of dodging at the nick of time or adding bonuses to damage by giving you a boost in damage for pressing a button at the exact right time when attack lands.

I’m kinda looking for a train of thought with some minor details.

I know these kind of systems use a Finite State Machine to manage combat so my guess is: During the Attacking state you’re allowed to press a button for attacking (likewise when being attacked) This button gets time stamped and checked against the move you’re using or being used against you. if it’s within that range then something happens appropriately?

Thank you for taking the time to read.