If I understand correctly how the unit based religion works now, than this is already in FFH2 so we don't need to code it ourselves. How it works is that it randomly picks a religion (with none also as an option) and assignes this to the settlet (or whatever unit it creates). If the settler than founds a new city, the religion is automatically there as well. What we could do when we have religions in every city from founding on (and just one per city) than maybe we can remove the none option and always assign that religion to the settler/unit. Also to found/give the first city the religion is making the beginning settler recieve a religion to begin with or maybe give the starting tech to the civ which automatically founds the city. Another possibility is to use python to just assign the religion to the city (but I would have to see were to check which religion and that it happens only the first time). If we do it all the time, this will make the code even simpler and can be in the python part of founding a city (assign the state religion to every city that is founded or something).