Is there any kind of “perishes after X turns” flag?
There is a byte in the unit data that is only used for certain units (settler workload, range for air units, caravan commodity). If this can be accessed and changed by lua functions, code could be written to count down that number (and eventually kill the unit) between turns, provided the unit doesn't need that functionality. There also seem to be a couple of bytes per unit with unknown meaning. If they are just extra information that got dropped from the final game, maybe the bytes can be used with lua. This description would be straightforward, but I don't know if ToTPP gives that functionality.
Another option is to store "extra" unit information in a state table. Indexing the table by the unit number could work, but there might be problems when a unit is killed or disbanded (especially disbanded, since events can be run when units are killed) and the table must be updated.
Suppose a player were to leave an archer in some city for a few turns, and fill it up with arrows, and thus eventually make the city close to unsiegable, at least to the AI.
It may be easier to use an event to kill all arrows in a square when the last archer in that square is killed, or to have a maximum number of arrows that can be accumulated per archer.