Is it possible to make a skill which only hits if the opponent is already afflicted with a specific state?
Like for my idea, you would have a skill called Knockdown, which would... knock the enemy down.
Then you would have an attack called Execute which would instantly kill the foe, but would only work if they were afflicted with Knockdown state.
Personally I think Bot's workaround for the Execute skill you mentioned is a bit longwinded. Try the following
b.state?(ID)? b.add_state(1) : 0
where ID is the number of you Knockdown state. This will add state 1 to your target (1 being the death state) if they are in the knockdown state. Else it will deal 0 damage (i.e. miss)
For this to work I think you will need to add a feature to the death state which reduces the targets hp to 0. OR you could make a state called something like Kill, which reduces the target's hp to 0, and just use the Kill state id in the add_state part of the formula.
A final way you could do it is
'b.state?(ID)? b.hp = 0 : 0'
this I think will be the most effective way because it will reduce the target's hp to 0 if they are in the knockdown state.
I just tested it both with the add_state and the b.hp=0 formula and both result in the display of "takes no damage" followed by the slain message. They formula works. If they are actually in the state that doesn't allow them to be executed then it just says takes no damage, which I think is what you're looking for.