YE Row Formations Enemy Position problem

When using an enemy position with a formula like 310 + (rowIndex * 40), the rowIndex will consider all enemies in the battle, including the half appear ones.

Is there anyways to make a formula that will consider only enemies that are visible?
3 days
3 days
3 days
3 days
3 days
3 days
3 days

Original thread: https://forums.rpgmakerweb.com/threads/ye-row-formations-enemy-position-problem.74684/