if that skill can still be used when theres no viable target, then theres 2 things i can think of that you might want to do here. (im not sure if that tag prevents selection from confirming if the targets array is empty. do make sure that this is the case before continuing)
How would I make this a conditional so that if there is no one with the state, it does [damage formula]?
building off of your question, you could ignore the target js tag, make it target all foes, and then return to the idea before where it deals boosted damage to those with the state active
I assume that if there is no one in the party with that state, this formula means that the enemy will do nothing, which is not what I want.
you can use whatever the VS equivalent for the requirement eval is to make it so that the skill can only be used if theres some foe with the state active. that way it cant be used and do nothing if theres no valid targets to begin with.
does either of those sound like they'd work? i think theyre better ways to go about it than changing the scope of the skill only if theres no valid targets, and then checking the target count in the damage formula, but itll only work if you say it does
also, that being said, what you have here confuses me a bit.
targets=$gameTroop.aliveMembers().filter(enemy => enemy.isStateAffected(114));
you said it targets actors at the start, but the skill's target code only looks at troop members, which are only enemies. if its a skill thats only usable by enemies, you should change the $gameTroop to $gameParty. If its actor only, you can keep it as is. if both enemies and actors can use it, you can use user.opponentsUnit().aliveMembers()... to get the user's foes' team