Guard, $4
+$1
Take a coin token.
----
When any player plays an attack card, you may reveal this from your hand. If you do and did not reveal a Guard to that attack card being played before, take a coin token and no player is affected by that attack.
Three comments. First, you can use Inheritance on Guard. Then when somebody plays an Attack card, you can reveal an Estate any number of times (you didn't reveal a Guard!) and take infinite Coin tokens. The wording you want is, "When any player plays an Attack, you may reveal a Guard from your hand. If you do…" This doesn't work with Inheritance at all, but that's the lesser of two evils. Also it's way shorter.
Second, I'm not sure whether this was your intent, but Guard shuts down Attack cards completely. Like, Militia doesn't even give +$2, because it doesn't affect the player who played it.
Third, even if you worded it so that it still affected the player playing the Attack, I think it shuts down attacks too hard in multiplayer games. In two-player games it's the same as Moat. You usually still buy e.g. Witch when your opponent buys Moats because some Curses are still going to get through. Sometimes they won't have a Moat in hand. But in a 4-player game, the chance that
any opponent has a Guard in hand is way higher, and one Guard shuts down your attack for all opponents.
I do like the general idea of a Reaction that gains Coin tokens when you're attacked, but I don't think it should also block the attack.