Mimic Skill

I've been trying to look through Yanfly's tip and tricks hopping he covered this already, but apparently not. Either through the default editor or through yanfly's skill core plugin, does anyone know how to recreate a 'mimic' skill as seen in Final Fantasy/Bravely series?

For reference, when used, the mimic skill imitates the previous command used by any party member or enemy without any consumption of the resources typically required to use the skill. (Like MP, TP, or HP).

Thanks for your time.
Now this was a tough one...
To somewhat replicate this you'll need the following Yanfly scripts:
The Mimic global state:
In your Auto passive states plugin you'll need to set up a new global state, which will have the following code in it's notebox.
Code:
<Custom Action Start Effect>
var action = user.currentAction();
if (action && action.isSkill()) {
  actionId = action.item().id || 1;
  if(actionId != x)
     $gameVariables.setValue(y, actionId);
}
</Custom Action Start Effect>
Where x is your actual Copycat skill ID, if you skip this you'll enter an infinite loop and break the game!
and y is a game variable which will store the id of the last used skill. Remember to not use this variable anywhere else!
Spoiler
upload_2017-12-8_21-0-30.png

The mimic skill
You want to set it up to:
Damage: None
Scope: 1 Enemy. You can expand this using Yanfly's target core.
Animation: None, unless you want to, but it might look funny.
Then paste this on it's notebox:
Code:
<After Eval>
  var id = $gameVariables.value(y) || 1;
  BattleManager.queueForceAction(user, id, target);
</After Eval>
The value of y is the id of the variable we talked about earlier.

Spoiler
upload_2017-12-8_21-15-24.png

The "without any consumption of resources" is beyond me, but I have a feeling it might be possible. But I don't know how yet.
Note that you'll be able to use the skill even if you don't have enought MP.

Try it out and tell me how it goes.
@Blue Symphony "without any consumption of resources" means not using mp or tp.
well mp cost "maybe" able to get around that. if that mimic skill can damage formula a.addState(x); 0
state x = MP cost 0%
as for something to reduce TP cost ????? idk aside from mimic skill giving u some TP when u use it to try n minimize the loss
either way saving this topic so can play around with it later
well mp cost "maybe" able to get around that. if that mimic skill can damage formula a.addState(x); 0
state x = MP cost 0%
as for something to reduce TP cost ????? idk aside from mimic skill giving u some TP when u use it to try n minimize the loss
either way saving this topic so can play around with it later
That works then.

My game wasn't going to use TP anyways. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/mimic-skill.88192/