How to limit a unit's build/production limit to 1 and death sprite removal?

I was able to make the TC produce a Khan, but I want to add a condition where, if 1 Khan is alive more Khans cannot be produced.

I also want to know how to remove the dead carcass before spawning a different unit, I am able to spawn a building out of a market car after dismantling it to produce a foundation. Is it possible to remove the dead car sprite instead directly go to the foundation?

Can anyone able to help me with these?

thanks in advance

Hey man. did you find the answer?
For the Khan, if you can enable a unit, you can also disable it. Check for Own object condition

For the dead carcass, you should use triggers remove the unit that corresponds to the dead unit of the cart. Empty dead cart is unit number 178 and is called TCART_D. Filled dead cart is unit number 205 and is called TCARTF_D. This info you can get it from AGE3, which is in the support tools folder of the game.

Edti: check SpoOky’s guide to triggers