# Drawstep engine · Conditions · `costPaidMatches` > Cost paid matches — CR 601.2h, 602.2b, 608.2h: exactly one object was sacrificed / discarded to pay this spell's or ability's cost and its characteristics immediately before the payment match the filter ("if the sacrificed creature was a Human", "if the discarded card was a creature card"). Engine: Magic: The Gathering (`mtg`). This is one primitive of the Drawstep card vocabulary; field names and the discriminator are exact. Wiki page: https://drawstep.xyz/wiki/mtg/conditions#costPaidMatches ## Where it goes A condition: `{ "kind": "costPaidMatches", … }` — in an `if` effect, a trigger's `condition` (intervening if), a static's `condition` ("as long as"), an activated ability's `onlyIf`, a replacement's `unless`. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `cost` | `"sacrifice" \| "discard" \| "returnToHand"` | yes | Which cost component: the sacrificed object, the discarded card, or the permanent returned to its owner's hand (as it last existed on the battlefield) | | `noun` | `"creature" \| "permanent" \| "artifact" \| "card" \| "land"` | no | The printed noun ("the sacrificed permanent", "the discarded card", "that land") | | `filter` | `ObjectFilter` | yes | Which objects (ObjectFilter; set fields AND together) | | `thisWay` | `"passive" \| "active"` | no | The printed "this way" wording of the same test: passive "if a Saproling was sacrificed this way", active "if you sacrificed a Klingon this way" | ## Minimal form ```json {"kind":"costPaidMatches","cost":"sacrifice","filter":{"types":["Creature"]}} ``` The engine reads that minimal form as: “the sacrificed permanent was a creature”. ## Stock examples - **Grab the Prize** — “Draw two cards. If the discarded card wasn't a land card, Grab the Prize deals 2 damage to each opponent.” ```json {"kind":"costPaidMatches","cost":"discard","noun":"card","filter":{"types":["Land"]}} ``` - **Wonderscape Sage** — “{T}, Return a land you control to its owner's hand: Draw a card. Then discard a card unless that land had a nonbasic land type.” ```json {"kind":"costPaidMatches","cost":"returnToHand","noun":"land","filter":{"hasNonbasicLandType":true}} ``` - **Thallid Omnivore** — “{1}, Sacrifice another creature: This creature gets +2/+2 until end of turn. If a Saproling was sacrificed this way, you gain 2 life.” ```json {"kind":"costPaidMatches","cost":"sacrifice","noun":"creature","filter":{"subtypes":["Saproling"]},"thisWay":"passive"} ``` ## Related - [Conditions](https://drawstep.xyz/wiki/mtg/conditions.md) — the whole topic - [Filters & targets](https://drawstep.xyz/wiki/mtg/targets.md) — how `target` / `filter` select objects and players (selection algebra) - [Start here](https://drawstep.xyz/wiki/mtg/start.md) — the rules, the output contract and the index of every primitive