I created a DLL which you can use.
You can download it
here (I also included the source changes I made).
Nothing clever. Just a little code to expose existing internal functions.
I haven't tested it myself, but it does compile
Let me know if something's not working so I can fix it.
This is what I added:
CyPlayer.setCityExtraDefense()
I added
CyPlayer.changeCityDefenseModifier(int iChange) (was already used internally, just exposed it to Python).
CyPlayer.changeWarWearinessPercent()
I added
CyPlayer.changeWarWearinessModifier(int iChange) (was already used internally, just exposed it to Python).
CyPlayer.setMaintenanceDiscount()
Exposed
CyPlayer.changeDistanceMaintenanceModifier(int iChange) and
CyPlayer.changeNumCitiesMaintenanceModifier(int iChange).
These already exist internally, so I preferred not adding a new untested functionality.
You can call them both with the same value to simulate your function.
This is what I didn't add:
CyCity.setExtraUnhappiness()
I believe you can use the existing CyCity.changeExtraHappiness() with a negative value.
It's not that simple. The revolt chances calculation is much more complicated than just a number (there are in fact 2 'random throws' for this).
If you want me to do something other than that, please specify.
I must say that a constant "30% chance of revolt" doesn't sound like such a good idea to me, since this city will probably revolt within a few turns anyway, so what's the point of conquering english cities?
I suggest something like 'player culture counts for an extra 50% in his ex-cities when calculating revolt chances' or something to that effect, in which case I can add this to the calculation and expose this to Python (this will, however, break saves as this modifier should be kept in the savegame file).
CyCity.setDomainExtraYield()
Not sure what it's supposed to do...