Making the enemy have the same stats as an actor

If I want the player to fight a party member as an enemy
is there a way I could put that party member's stats as that enemy's?
So you want to set an enemy's HP, MP, atk, def, matk, mdef, agi and luk to that of a party member at the time you fight it?
Exactly, sorry if I was alittle vague.
Do you want it to be a specific actor every time or whoever is occupying a particular party slot when the battle happens?
Do you want it to be a specific actor every time or whoever is occupying a particular party slot when the battle happens?

A specific actor
Okay, here's what you do. Make a troop event in the troop that contains the party member you'll be fighting, and insert the following script call:

Code:
var actor = $gameActors.actor(your actor ID here);
var stats = [actor.hp, actor.mp, actor.atk, actor.def, actor.mdf, actor.agi, actor.luk];
$dataEnemies[ID of your party member monster].params = stats;

Presto, your enemy now has the given actor's stats.
Not sure it's working did do this right?

Code:
var actor = $gameActors.actor(22);
var stats = [actor.hp, actor.mp, actor.atk, actor.def, actor.mdf, actor.agi, actor.luk];
$dataEnemies[18].params = stats;

18 being the enemy ID
and 22 being the actor ID
That should work. What is it not doing?
I'm testing it as a basic actor, hardly any stats
and applied that code to the monster
and made that Actor monster's stats overpowered
but when I battled it died the monster died in the first couple of hits.
Note that this code will set the monster's stats to whatever the actor's were at the time of running it. It will overwrite whatever monster stats you've set in the database.
Alright But I set the Actor's stats high with both their equipment and their class.
when I ran the troop with that script.
Can you show me a screenshot of your troop event, the enemy and the actor?
Alright
Untitled.png
Untitled.png
Untitled 2.png
Untitled 2.png
Untitled 3.png
Untitled.png
Untitled 2.png
Untitled 3.png
Crap, Kinda messed that up.
But I guess you get the point.
So what should the stats of the Champion class be at level 60?

Oh, FFS. Change the activation condition of your troop event to Turn 0+0*x.
It was that simple? xD

Original thread: https://forums.rpgmakerweb.com/threads/making-the-enemy-have-the-same-stats-as-an-actor.75382/