MV How to target all enemies in 2 rows? (Row Formation, Target core)

I have 3 rows in total. I'm making an AOE skill that hits all enemies on the first 2 rows. So if there are no characters in row 1, the skill hitbox will shift to row 2 and 3. I have tried to work this skill with row formation, target core and selection control but couldn't find a solution to make it work. Is there a way to do this?
have you tried the area of effect plugin? im assuming you have all yanfly plugins
Yes, I have tried the AOE plugin but that plugin doesn't work well. It kept targeting enemies that are not within range as shown in the picture.
1612498392085.png
from the target core plugin description:

Code:
  <Target: Enemy Row>
  This will target the enemy row equal to that of the currently selected
  target enemy. The entire row will be selected as a whole.

  <Target: Enemy Row x>
  This will target specifically the enemy row x for the enemy unit. The
  entire row will be selected as a whole.

  <Target: Front Enemy Row>
  This will target the front-most enemy row with alive members. If there is  a row without any alive members, this will target the next row with an
  alive member.

  <Target: Back Enemy Row>
  This will target the back-most enemy row with alive members. If there is  a row without any alive members, this will target the next row with an
  alive member.

  <Target: Ally Row>
  This will target the enemy row equal to that of the currently selected
  target enemy. The entire row will be selected as a whole.

  <Target: Ally Row x>
  This will target specifically the allied row x for the allied unit. The
  entire row will be selected as a whole.

  <Target: Front Ally Row>
  This will target the front-most ally row with alive members. If there is
  a row without any alive members, this will target the next row with an
  alive member.

  <Target: Back Ally Row>
  This will target the back-most ally row with alive members. If there is
  a row without any alive members, this will target the next row with an
  alive member.


and this is from the row formation plugin:

Code:
battler.row()
This will return the row the battler is currently resided in.

battler.rowIndex()
This will return the battler's index in relation to the other battlers of
the same team in the same row.

battler.isRowLocked()
This will return a true/false if the battler is row locked.

battler.setRow(x)
This will set the battler's row to x. In battle, this will visually move
the battler there, unless the battler is the active battler.


if the default tags from the target core dont work, you could try this custom eval notetag with the information from the row plugin:

Code:
<Custom Target Eval>
   //get the alive friends of the target and put them on a list
   var members = target.friendsUnit().aliveMembers();

   //remove the target from the list (or else it will be hit twice)
   members.splice(members.indexOf(target), 1);
   //check if the rest is in a different row from the initial target's:
   for(var j = 0; j < members.lenght; j++){
      var member = members[j];
      if(member.row() != target.row()){
         //remove them from the list if their rows are different
         members.splice(members.indexOf(member), 1);
      }
   }
   //now with target list done, push them into the targets list, which contains thge initial target
   for(var i = 0; i < members.lenght; i++){targets.push(members[i]);}
</Custom Target Eval>


check if this works. the skill must have one target as scpoe.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-target-all-enemies-in-2-rows-row-formation-target-core.133020/