How to name a enemy the same as an name input named actor

Hello, I'm in need for a way to have an enemy name that changes with the players named in the name input screen.
I've tried using Yanfly's Message Core (http://yanfly.moe/2015/10/10/yep-2-message-core/) but that is for messages only.(it pops up as \n[number] instead of the name) I want the name to reflect the actors name, whatever the player is named.
https://forums.rpgmakerweb.com/index.php?threads/change-enemy-name.79407/#post-740367
Do this in a turn 0 battle event and change the text to the actor's name.
If you don't know the command to get an actor's name from its id look into the javascript equivalent of event commands thread.
Where is the javascript equivalent thread that you were talking about?
Edit: Can you also explain how to make the code functional (Is it the index of the enemy in the first [] then the name script in the return {}?)
It's a sticky in the rpg maker MV sub forum.

Replace index by the index of the enemy and 'your new name" by what you'd like to use as a name.
it doesn't seem to be renaming the character. Here's what i put in.
Spoiler
$gameTroop.members()[6].name = function() {return $gameActors.actor(1).name()}
Your code is working just fine for me.
Check that the enemy index is correct, remember that indexes start at 0 (so indexes are 0 to 5 for a troop of 6 enemies).
Okay, i get it now. So your do the order of enemys, not the order in the database. Thanks for your help!
Glad you've got it working!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-name-a-enemy-the-same-as-an-name-input-named-actor.107689/