Fog color from the skybox environment

Context
I want to make a realistic scene where there’s the terrain + sky box environment. I’m using a Sky shader from this example: https://threejs.org/examples/?q=water#webgl_shaders_ocean

I want to make the terrain kind of fade into the environment using something like fog, but the problem is that it doesn’t look realistic if I try to match the colors manually. And also to make it look realistic it should depend on the time of the day.

The solution I’d like

I want to use the environment color for the fog and be able to define its density.
Does anybody know how that can be achieved?
Maybe you could just point me in the right direction on how to set it up and I’ll create a shader by myself. I’m not very aware of places in the code where it could be done in the easiest way possible.

Describe alternatives you’ve considered

Solution 1: Use a separate shader and keep a standardscene.fog disabled.
Solution 2: changing the fog’s shader (which probably isn’t a good idea)

Does anybody know the easiest way to do it? Thank you!