enf91 wrote:Those militia can only be "replaced" by adding two militia regiments together. The database is scripted so that such elements are never automatically added.
You are misunderstanding how the initial unit element makeup definition(s) and the replacement element definition(s) interact with each other.
If a 2-element Militia unit has been formed by combining 2 individual Militia units, and BOTH of those elements get upgraded to normal infantry via event, ONCE one of those normal infantry units gets eliminated in a combat it would be replaced by a new Militia replacement element since the 2 element Militia unit is defined for replacement purposes to be made up of 2 elements of FamilyType = $famMilitia
The reason why the unit starts out with a single element is the initial definition of the unit contains only 1 element of $famMilitia allowing for the merger of the second element which does not automatically occur as you are correctly pointing out.
Another way of stating it is: Once the 2nd element is added AND neither of those elements are of the $famMilitia (FamilyType), due to upgrades, then the elimination of either upgraded element would call for the replacement of the missing element which would then be a Militia element.