MV Need help with a skill

Hi,
I want to make a skill that if it targets actor 1 and switch 259 is turned on adds state 63 to that actor.
Here's what I figure should do the trick in the damage formula, alas it does not.

b === $gameActors.actor(1) && $gameSwitches.value(259)? b.addState(63);

What am I doing wrong?
Thanks in advance!
You can't only do half of a ternary operator. It must have the format
if ? then : else

You also don't appear to have any actual damage formula, which means you're going to see a floating 0.

For what you're trying to do, you only need a regular if statement.
Code:
if (b == $gameActors.actor(1) && $gameSwitches.value(259)) b.addState(63); damage formula here
That did it, thanks.
Yeah, that no damage formula is on purpose, it's a buffing skill that adds another buff if the player learned a perk before. I don't think there's a way to just remove that unless I'm mistaken, so I've just come to accept it :/
Anyway, thanks for your help!
Yeah, that no damage formula is on purpose, it's a buffing skill that adds another buff if the player learned a perk before. I don't think there's a way to just remove that unless I'm mistaken, so I've just come to accept it :/
Well, you would use a plugin to execute this code instead of having it marked as a damage skill that does no damage.

Yanfly's Skill Core is a very popular plugin that gives you notetags that will run code at various points in the skill's resolution - you would make the skill have no damage type and put this into one of those notetags instead.

Then there's no janky 0 damage popup when you use it.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-a-skill.173247/