I can hopefully give you a bit of a start, but I can't tell you everything! Not sure how your system is set up.
Start by making a new input in the input manager (Edit->Project Settings->Input. Increment the "size" value by 1. Rename this "Crouch". It's important to remember the right name, later in the script. Fill in the details using something like "Jump" as a reference for the Sensitivity/Gravity etc. but make the key "shift" or "c" or whatever, rather than space).
Now, right click in your project window somewhere to make a new script (I'm going to use C# for the sake of this example). Name it "CameraCrouchOffset".
Drag this component onto the camera in your hierarchy, so that the behaviour is attached to the camera. Make sure the camera is a child of your character controller, and that its initial position is 0,0,0 relative to its parent.
Above the "start" function, add:
public float StandingEyeHeight = 0.0f;
public float CrouchingEyeHeight = -0.75f;
These will now be tweakable in the component's window, so you can get the right heights later on.
In the Update function, add something like:
//The transform.up, below, gives the object's own "up" vector, rather than world's "y" axis. This is better practice.
Vector3 StandingEyeOffset = transform.up * StandingEyeHeight;
Vector3 CrouchingEyeOffset = transform.up * CrouchingEyeHeight;
//The value of Input.GetAxis("Crouch") is going to be between 0 and 1.
//So when it's at zero, the camera's offset will be equal to StandingEyeOffset.
//When it's 1, the offset will be the same as CroucingEyeOffset.
//If it's anywhere inbetween, it will be a blend of the two target vectors.
transform.localposition = Vector3.Lerp(StandingEyeOffset, CrouchingEyeOffset, Input.GetAxis("Crouch") );
After you've done that, and tested that it shifts your eye up and down, you might find that it jerks between heights too much. You could make your own value to "slide" between 0 and 1, or, as a quick fix, You could go back to the input manager and tweak your "Crouch" virtual button. Change the "sensitivity" and "gravity" values to make the eye position transition smoothly. They're probably both 1000 at the start, which makes the button press effectively "instant" between 0 and 1. Try setting them both to about 5 for it to have a quick, but still noticeable transition.
1 second / 5 u/s = 200ms duration for the transition.
After that, you can tweak the heights in run time! Remember to remember your desired heights, and possibly replace the defaults at the top of the script file with them, then on the component view, right click -> reset on your CameraCrouchOffset component to reset it to the default values in the script.
I don't know java script... or... just enough to convert it to c#! Sorry!
– anon86285172