MV Target selection depending on its (and actor's) row position?

Greetings! Here I am again in panic, because I just can't figure out how to do a certain thing. 😢

First the important premises, I'm using yanfly "SELECTION CONTROL", "TARGET CORE" and especially "ROW FORMATION" plugins (and many more but oh well) 😅

What I would love to make, is a Skill that works like a semi-ranged weapon. My system is programmed for 3 rows (Front, Middle and Back). What I'm trying to do, is create a skill that can target an Enemy up to a distance of 3 Rows from the User. What I mean is, if the User is in the "Back" row, the skill could only be targeting the "Front" enemy Row. If the User is put in the "Middle" Row, then the Skill will be able to target an Enemy in the "Front" or in the "Middle" enemy Row. And of course, if the User is placed in the "Front" Row, he will be able to target in any enemy row.

That fact is, I have no idea how to make this. I know how to use commands that limit the skill, like binding the target selection up to certain Row number, but that is not the case I'm trying to make. I tried searching for something similiar but I couldn't find anything 😴 Any help would be super appreciated! ♥♥♥ 🙏
Moved to: Plugin Support
Moved to: Plugin Support
Oh gee, sorry I took the wrong section 😢''''
I am still trying figuring out, and I think it should be something like.... this?

Code:
<Select Conditions>
if (user.battler.row() === 1) {
Row 3 Max
}
if (user.battler.row() === 2) {
Row 2 Max
}
if (user.battler.row() === 3) {
Row 1 Max
}
</Select Conditions>
But with this, the Skill can only target Row 1, even if the User is in Row 1 or 2
Maybe I'm still doing something wrong with the code (yeah, of course, "M A Y B E" duh 😔)
I should change the way I write the conditions, but I think the function is something like that. I know it's hard to tell but I'm a newbie with JS (teheh 😂)


OK SO I nearly figured it out in my own way~ BUT NOT QUITE EVERYTHING.
It works perfectly if the User is in Row 1 and Row 3, but not in the Row 2.
I'll show you what I did:
I created 3 different Skill, and I gave different "Range" to them (The Actor learn the other 2 automatically as soon as he/she/it learn the main one). One is supposed to be available only in the Row1, another only in the Row2 and of course the last one only from the Row3. Every one of them has a different <Select Conditions> naturally, so this is the Skill if it's from ROW1:

Code:
<AOE Radius: 80>   //yes, it's an AOE skill (YEP_X_AreaOfEffect PLUGIN)
<Row Only: 1>      //usable ONLY in the Row1

<Custom Show Eval>                   //This is for completely HIDING the Skill if the Actor is NOT in the Row1
if (user.isStateAffected(13)) {      // ...by checking the Row State
visible = true;
} else {
visible = false;
}
</Custom Show Eval>
// No need to declare a Custom Select Condition here, since it's ok to be able to Select any target, if the User is in the Row 1

The ROW2 version of the Skill is like this:

Code:
<AOE Radius: 80>
<Row Only: 2>       //usable ONLY in the Row2
<hide in field>     //This will make the illusion to have only one version of the Skill, as the row-variants are not visible outside the battle

<Select Conditions>       //Capable to target only from Row1 to Row2
Row 2 Max
  </Select Conditions>

<Custom Show Eval>                   //This is for completely HIDING the Skill if the Actor is NOT in the Row2
if (user.isStateAffected(14)) {      // ...by checking the Row State
visible = true;
} else {
visible = false;
}
</Custom Show Eval>

The ROW3 version of the Skill is like this:

Code:
<AOE Radius: 80>
<Row Only: 3>         //usable ONLY in the Row3
<hide in field>         //This will make the illusion to have only one version of the Skill, as the row-variants are not visible outside the battle

<Select Conditions>       //Capable to target only the closest Row
Front Row Only
  </Select Conditions>

<Custom Show Eval>                   //This is for completely HIDING the Skill if the Actor is NOT in the Row3
if (user.isStateAffected(15)) {      // ...by checking the Row State
visible = true;
} else {
visible = false;
}
</Custom Show Eval>

The Row1 and Row3 versions are PERFECT like this, everything works smoothly. The only problem remains for the Row2 version. The targeting is nice, but the Skill COMPLETELY lose the AOE effect! D: I see that the only difference in scripting it, is the "Row 2 Max" condition for the Custom Target, so I think the problem lies there? 👋

Original thread: https://forums.rpgmakerweb.com/threads/target-selection-depending-on-its-and-actors-row-position.143185/