# Drawstep engine · Costs · `chooseX` > Choose x — CR 107.3b, 601.2b: bounds on announced X. Evaluate max before paying costs, independently of affordability. 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/costs#chooseX ## Where it goes One part of a `cost` object (an activated ability's cost, `mayPay`, `unlessPays`, an `additionalCost`): `{ "chooseX": … }`; parts combine freely. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `chooseX` | `{ min?: number; max?: ValueDef }` | no | CR 107.3b, 601.2b: bounds on announced X. Evaluate max before paying costs, independently of affordability | ## Stock examples - **Positive Counter Witness** — “” ```json {"chooseX":{"min":1},"removeCounters":{"counter":"charge","amount":{"kind":"var","name":"X"},"anyNumber":true}} ``` - **Minimum Spell** — “X can't be 0.” ```json {"chooseX":{"min":1}} ``` - **Thieving Skydiver** — “Kicker {X}. X can't be 0.” ```json {"chooseX":{"min":1},"mana":"{X}"} ``` ## Related - [Costs](https://drawstep.xyz/wiki/mtg/costs.md) — the whole topic - [Values](https://drawstep.xyz/wiki/mtg/values.md) — every number kind an `amount` accepts - [Start here](https://drawstep.xyz/wiki/mtg/start.md) — the rules, the output contract and the index of every primitive