Set variable to enemy name

I can't find any solution to this problem and been searching through forums with no solution so far.

So, i have this skill which set certain variable to target name through script call.
I tried using $gameVariables.setValue(xx, b.name), but it doesn't work.

Are there any solutions ?
I can't find any solution to this problem and been searching through forums with no solution so far.

So, i have this skill which set certain variable to target name through script call.
I tried using $gameVariables.setValue(xx, b.name), but it doesn't work.

Are there any solutions ?
to find a specific name of an enemy via script call you can use that:

$dataEnemies[1].name

Where "1" is the id for this enemy in the database.
Or you can use that during battles

$gameTroop.members()[id].name()

where id is ID of enemy (starting from 0)

Original thread: https://forums.rpgmakerweb.com/threads/set-variable-to-enemy-name.108336/