Currently, there is no method to add Magnetic Declination or any other custom declination for the compass item by scripting methods. I have tried to use setCompassOscillation in the hopes that it could be useful for this but unfortunately, because setCompassOscillation is random and is based on a variable timer, it cannot be used to set a controlled heading for the compass.
Creating a script command called something like "setCompassDeclination" that modifies the compass heading similar to setCompassOscillation, but without the random flipping between negative and positive values or the variable timer would make this possible. That way, it could be used to set a negative (western) declination or a positive (eastern) declination. Alternatively, setCompassOscillation could have modified syntax to support compass headings that do not flip flop between two values randomly.
I would imagine the syntax for a new command may look something a bit like this:
Example 1: Set the compass to a -13 western declination.
setCompassDeclination [rad -13];
Example 2: Set the compass to a +15.5 eastern declination.
setCompassDeclination [rad 15.5];
Example 3: Set the compass to follow grid north (vanilla compass behavior).
setCompassDeclination [rad 0];
This, or a similar solution, would be able to be used to create a more authentic land navigation experience through modding and allow each terrain to have a different declination that players would have to compensate for by using real world land navigation skills.
Thank you for your time and consideration.