Remove at Age - KonradHeinser/EBSGFramework GitHub Wiki
This gene class will cause the gene to be removed if the pawn's age becomes too high. All gene classes in this framework can use this by default, though it's recommended to use the hediff adder if you aren't using any other as that is the most advanced gene class that can be used without any errors related to missing tags.
Enabling this only requires one tag added to the extension, as shown in this example gene that is removed at the age of 50:
<GeneDef>
<defName>MaxAgeGene</defName>
<label>max age gene</label>
<description>.</description>
<iconPath>UI/Icons/Genes/Gene_HairColor</iconPath>
<displayCategory>Miscellaneous</displayCategory>
<geneClass>EBSGFramework.HediffAdder</geneClass>
<modExtensions>
<li Class="EBSGFramework.EBSGExtension">
<removePastAge>50</removePastAge>
</li>
</modExtensions>
</GeneDef>