XP Script to know which specific enemy the character has targeted, and which enemies are in a fight?

Small explanation required: I'm making a fear and hunger type system. Instead of attacking a whole enemy, you attack their body parts. They have a specific weak point (like the head) with high evasion and low HP, that if killed kills that enemy. To do so, each body part is an individual enemy that I assemble in troop.

My problem comes with a skill I wanna implement. It basically would let you know the weak point of the enemy and lower its evasion, AND tell you extra information on it (like weaknesses and stats). It would be single target, and if you use it against idk the torso, it would still show you the weak point of the enemy in general. However, I have not found any option that lets me see what enemy there is in battle.

I've tried assigning a variable to the troop on turn one and then using a common event. It works fine on battles against single enemies, but falls apart on battles with more than one enemy. If there is more than one enemy, I want to show only the info of the enemy they targeted, but with my workaround I have to show the info of all enemies and to make vulnerable the weak points of both enemies which is too broken.

If I could see what enemy they're targeting specifically, I could use that in a conditional branch to do the events and it'd work fine. But I haven't found a way to do so

TL;DR: Is there a way to see what enemy is in a fight, and what enemy the character has targeted? I'm unsure if it's doable with scripts, but appreciate all the help I can get
You can add a short little script to expose the "active battler" (i.e. the character or enemy that is currently taking an action) which will then let you get what you want via the script conditional branch. Start by adding this script to your scripts (F11).
Ruby:
class Scene_Battle
  attr_reader :active_battler
end

Now you can access that in an conditional branch using:
Ruby:
$scene.active_battler.current_action.target_index == 1 # replace "1" with the enemy in your troop you want to check for

The "current_action" of the "active_battler" stores all the information about what the battler is doing. Check out the default script named "Game_BattleAction" if you want to see what else you can access. For example, "skill_id" will let you know the ID of the skill being used.

Original thread: https://forums.rpgmakerweb.com/threads/script-to-know-which-specific-enemy-the-character-has-targeted-and-which-enemies-are-in-a-fight.181513/