Only issue is I can apply both items whenever I want - I need them to only be able to apply if certain a state is active on an actor.
You can't do that within the Damage Formula. The Formula takes place after the item/skill has started to perform its action, which is way after the target selection.
The other thing for you to keep in mind (perhaps you don't understand in the first place) is that the damage formula is always used when you're damaging/healing the target in some way; it requires that a number get produced, and it will show that number. So even if it's 0, doing things like this is going to end up with the player using your item in the game and that 0 damage or healing popup displaying on the screen, which I would consider aesthetically undesirable.
For Bandages, what you describe should actually be the default way the engine works - if you have an item and the only thing on it is a Trait that removes your Bleeding state (no unnecessary Damage Formula at all), the game should not allow you to expend that item on a target who doesn't have the state to be removed.
If you have both that Trait and one that restores HP, then you'll be allowed to use the item if
either trait would result in a change to the target actor. So the easiest way to implement what you want is to make a simple item, one trait to remove the state, and that's already how the engine works.
Splints are a bit more complex. I need a Splint to check if Broken Bones is applied and remove the Broken Bones state but THEN add a new state called Splinted. Likewise, if Broken Bones is not applied, do nothing and keep the Splint (whether thats by a consume/replace or not).
This
could be done in the damage formula - the trick is, it'll "break" your item. That is, as I described above, you can't stop the player from using the item on an actor who doesn't have Broken Bones. You can use code to restore the item after, so it nets out, but it will behave differently from all of the rest of your items that sit there and give an error sound on an invalid target.
If you don't care about any of that, then you can do:
Code:if (b.isStateAffected(brokenBones)) {b.removeState(brokenBones); b.addState(splinted)} else $gameParty.gainItem(itemId, 1); 0
where brokenBones, splinted, and itemId are replaced by the appropriate database IDs (no leading 0s).
You may find this a more useful thread that has instructions on how to do exotic things in your damage formulae:
Damage Formulas 101