Lua, unsurprisingly, will be required.
Ideally it should go something like this:
1) Get the number of units the player has with the function Player.GetNumUnits()
2) once you get that number, divide it by 5 using math.floor, kind of like this:
Code:
numExtraDelegates = math.floor(numUnits / 5)
3) I think this should speak for itself:
Code:
player:GetCapitalCity():SetNumRealBuilding(GameInfoTypes.BUILDING_XTRA_DELEGATES, numExtraDelegates)
4) Hook into GameEvents.PlayerDoTurn so it fires each turn. Done.
EDIT: SPOILER = Free code, but optimally you should learn to code it like I'm trying to
Now, for BUILDING_XTRA_DELEGATES, give it the column <ExtraLeagueVotes> set to 1, and give its buildingclass the column <NoLimit> set to true. You also may want to
make the building invisible, optimally.
Also... potentially a super-OP UA.