Is there a way to target certain enemies in certain rows at once with Yanfly's Row Formation?

I've been using Yanfly's Row Formation and I've found myself stuck trying to work out an attack.

Say I have 4 rows to correspond with 4 battlers.
I want to make an attack that checks if battler 1, 2, and 3 are standing in row 1, 2 or 3.
Handy diagram:
⬛⬛⬛⬜
⬛⬛⬛⬜
⬛⬛⬛⬜
⬜⬜⬜⬜
If the above battlers are found standing in that range they will take damage, if they are standing outside they will take no damage.

The problem is I can't quite figure out how do this. I've tried making a for loop but that's only useful for checking battler indexes above 2. I've also tried using the "target enemy row" notetags with Yanfly's Target Core but that doesn't seem to work either.

Is there's a solution to this? I would greatly appreciate it.
Never mind I worked it out myself. If anyone else finds thread and is looking for an answer.
Add a row state for each row using the plugin's parameters and put this in a damage eval's notebox tags if you're using Yanfly's Skill Core.
Code:
dmg = [YOUR FORMULA HERE]
// Get the target's alive allies.
var members = target.friendsUnit().aliveMembers();
// Loop through each member and ignore the fourth..
for (var i = 0; i < members.length - 1; ++i) {
    // Get current looped member
    var member = members[i];
    // Check if member is in these rows
    if (member.isStateAffected(YOUR STATE ID HERE) || member.isStateAffected(YOUR STATE ID HERE) || member.isStateAffected(YOUR STATE ID HERE)) {
        member.gainHp(-dmg);
    }
}

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-target-certain-enemies-in-certain-rows-at-once-with-yanflys-row-formation.113125/