I’ve tried to change it, but it seems to be hard-coded. If you choose to change Sim’s last name, the dialog will state there’s a new baby and it needs to be given a name. However, as this omits gender-sensitive last names (like the ones ending with “-ski”, “-ska” or “-ova”), there are also versions that will display the dialog without regard to ex-spouses last names. That way you won’t be flooded with pop-ups if your Sims have different last names. If you have version ending with “if same”, dialog window asking if your Sim wants to change their last name will appear only if divorcing Sims have the same last name. The ones with “friendly” in their name are meant to be used with friendly break-up, but they have to load after Midge’s mod.