Check skill/item target during scene_battle

Hi everyone, how can I access the target of a skill during Scene_Battle?

I'm modifying Yanfly Visual Battlers(https://yanflychannel.wordpress.com/rmvxa/battle-scripts/visual-battlers/), I wanted for the actor to step forward only if the target is an enemy, and remaining still while guarding, healing, or buffing allies, this is the method  which handles that:

Spoiler
 #method inside class Scene_Battle < Scene_Base#--------------------------------------------------------------------------# alias method: execute_action#--------------------------------------------------------------------------alias scene_battle_execute_action_vb execute_actiondef execute_actionstart_battler_move_forward # unless current skill/item target is an actor(how to check this?)scene_battle_execute_action_vbend#--------------------------------------------------------------------------# new method: start_battler_move_forward#--------------------------------------------------------------------------def start_battler_move_forward return if @subject.started_turn @subject.started_turn = true @subject.move_forward wait_for_movingend
I thought I could use the equivalent of b in the damage formula, but I can't find how to access that, I tried !BattleManager.target.actor? , but target is not a valid method, then I tried "opposite?(@subject)" , the method from Game_Battler class, but I'm not sure how to access it too.

Help! Please  🙁
Try @subject.current_action.target_index
Nice! It seems to work, thanks, but what is the index for allies?

I tried @subject.current_action.target_index>=0 and it returns true only when guarding, but not when healing, and if I put it <=0 it still returns false when healing  🤔 ,

maybe allies have a different method from target_index...

If it is to much of a bother I'm also fine like this. 
start_battler_move_forward unless @subject.current_action.item.for_friend?

Try that.
Okay it works perfectly, thank you so much!
You're welcome! Glad to be of assistance.

Original thread: https://forums.rpgmakerweb.com/threads/check-skill-item-target-during-scene_battle.38928/