If I promise to visit you for dinner, but then it turns out that I have a nasty case of the flu, I don't need to come, and indeed shouldn't come. But I could also promise to meet you for dinner even if I have a nasty case of the flu, then if the promise is valid, I need to come even if I have the flu. I suspect, however, that typically such a promise would be immoral: I should not spread disease. But one can imagine cases where it would be valid, maybe say if you really would like to get the flu for a serious medical experiment on yourself.
In my previous post, I gave a case where it would be beneficial to have a promise that binds even when fulfilling it costs multiple lives. Thus, there is some reason to think that one could have promises with pretty drastic "even if" clauses such as "even if a terrorist kills ten people as a result of this." But clearly not every "even if" clause is valid. For instance, if I say I promise to visit you for dinner even if I have to endanger many lives by driving unsafely fast, my "only if" clause is not valid under normal circumstances (if we know that my coming to dinner would save lives, though, then it might be).
One can try to handle the question of distinguishing valid from invalid "only if" clauses by saying that the invalid case is where it is impermissible to do the promised thing under the indicated conditions. The difficulty, however, is that whether doing the promised thing is or is not permissible can depend on whether one has promised it. Again, the example from my previous post could apply, but there are more humdrum cases where one would have an on balance moral reason to spend the evening with one's family had one not promised to visit a friend.
Maybe this is akin to laws. In order to be valid, a law has to have a minimal rationality considered as an ordinance for the common good. In order to be valid, maybe a promise has to have a minimal rationality considered as an ordinance for the common human good with a special focus on the promisee? To promise to come to an ordinary dinner even if it costs lives does not have satisfy that condition, while to promise to bring someone out of general anesthesia even if a terrorist kills people as a result could satisfy it under some circumstances. It would be nice to be able to say more, but maybe that can't be done.