First mod:
Genealogy of new baby start with grandparents genealogy changed with respective parent toxicity and than combined and again changed by mother toxicity and biased toward one parent based on gender chance from settings. Change is random deviation from 50 - 50 split limited by toxicity and constant in mod.
For second:
Are you using Ralph's Moded version because temptext is defined inside it? And it is simple chance to do same as maturing pot each day based on slave genealogy and current age.