I've tried this on multiple occasions but CANNOT get any code to work.
Here is the code for adding diplomacy based on charisma:
<GameModifier>
      <Target>Player</Target>
      <ModType>Resource</ModType>
      <Attribute>DiplomaticCapital</Attribute>
      -->
  <!-- Use the sovereign's charisma stat to determine how much diplomatic capital they get -->
      <Calculate InternalName = "Value" ValueOwner="PlayerSovereign">
        <Expression><![CDATA[
[UnitStat_Charisma]]]></Expression>
      </Calculate>
    </GameModifier>
Doesn't work though. I wish it did, lol.
I've been trying to use this so that the gold per turn from a Merchant would be based on his stats. Thus, as a Merchant levels he'd be getting you more income. It'd do wonders for my traits and abilities mod.