How can i make an ability that affect any actor target with an script?

Hi guys.
Basically, i´m using the XRXS ATB Battle System script, and i´m making an ability (for one especific actor) that fully recharges the bar of another actor from his choice. The hard part is let him choose. I can define a especific actor to get the bar fully recharged, but, for some reason, a error in the Game_Actors script happens when i set to anyone with the target to get recharged. I really have no idea of what is happening here.

This is the one that i made for testing and works with the actor from the ID:1
44.PNG


This is the one that is supposed to recharge the the targed actor:
33.PNG


And this is the error and the script:
11.PNG


22.PNG


What is happenig here?

Thanks for reading
@target_index is the same as nil so it'll never work the way it is now. Assign it a valid ID first.
@target_index is the same as nil so it'll never work the way it is now. Assign it a valid ID first.
Thank you for showing me the path, but how can i make the @Target_index get the id or position of the actor? I spend 2 hours trying to understand how the scripts perform a certain action on an actor and still cannot understand
Are you using the default BS? or a custom one?
Are you using the default BS? or a custom one?
I´m using the XRXS ATB Battle System. He adds the ATB bar that progresses besed on agility. When the bar reach the end, the actor can perform an action. I haven´t looked yet for a mention of the target in this script, just on the default. I completely forgot that he could have anything related. I´ll give him a look

I´m using the XRXS ATB Battle System. He adds the ATB bar that progresses besed on agility. When the bar reach the end, the actor can perform an action. I haven´t looked yet for a mention of the target in this script, just on the default. I completely forgot that he could have anything related. I´ll give him a look
I haven´t found nothing useful related to target there
Well, I don't know where to get that custom ABS so I can't tell you how that script would precisely select the current battler, especially if he's a hero.

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-make-an-ability-that-affect-any-actor-target-with-an-script.176143/