Trying to make a Libra/Scan skill Script

Trying to make a libra skill in Rpg Maker Vx Ace. My skill saves the enemy index in a variable. Sooo I made this:

target = $game_troop.members[$game_variables[23]]

What I want to do is this:

target.hp to get the enemy hp
target.mhp to get the enemy max hp

and so on.

From what I've read I'm trying to put an array in a variable, that's why it is not working, so what do I have to do to set my "target"?
Sorry, I was mistaken(I wrote MV code).
I'll be more careful.
Under that is all not correct.



I think '$game_troop' is not exist but '$gameTroop' is OK.
And should write members()[number].

So, I test that code.
PHP:
var target = $gameTroop.members()[1];

console.log(target.hp);

These code worked well.

I hope this reply help !

Additional
:
If you want to get number of variable in MV, I think '$game_variables[23]' don't work well.
Please try using '$gameVariables.value(23)' instead.
@Tsumio My bad, gonna edit the first post, I'm not talking about MV, I'm talking about Vx Ace. I thought I didn't need to say cause this is the Ruby Forum.

Edit: Solved.
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-make-a-libra-scan-skill-script.82742/