Yeah RPG Maker does the majority of the coding, so there's no need to be overly complex with it, but yeah a state machine is already in built. If turn = X then do attack Y, if HP is below 30% then boost stats and use attack Z, otherwise do attack A at 50% and attack B at 50% for example.