Enemy loading ultimate skill

Hi everyone. I would like to do the same thing as Octopath Traveler, when bosses start loading their ultimate skill at the end of a turn and unleash it during the next one and acting after my team. If someone as an idea about how I can do this, it would be nice. By the way, I'm using VisuStella's plugins.
I dont use MZ so i cant really help with writing it, but it sounds like you can use a troop event to trigger your boss to use the charge up skill at whatever hp% threshold you want, have said charge skill put a 2 turn state on the boss that when it expires, forcequeues the ultimate attack, and then maybe have that attack also put another 2 turn state onto the boss that reduces their AGI to 1 so that they dont end up doing their ultimate -> another raidwide aoe by their next turn and wipe the party out before the player could respond
much simpler, it can be done in the action pattern without any plugin or event.

you create a state "charging up" with a skill that applies it, have the state last exactly two turns.
then make that state the condition for using the ultimate skill, with a rating high enough to disable all other skills.

whenever the enemy uses the charging skill, the next turn will be the ultimate skill.
https://forums.rpgmakerweb.com/index.php?threads/charge-gauge-skill-for-bosses.145446/#post-1257424
You can use this as a idea

Original thread: https://forums.rpgmakerweb.com/threads/enemy-loading-ultimate-skill.160906/