Rightclick resets every frame when manipulating cinemachine

First of all I just want to say that I am really new to unity so I apologise if this is very easy.

So I am trying to make a Cinemachine Freelook camera only move with rightclick is pressed.
It kind of works. But if I click I have to move and release the button within the same frame.

public void Start()
    {
        CinemachineCore.GetInputAxis = GetAxisCustom;
    }

    public float GetAxisCustom(string axisName)
    {
        if (Input.GetMouseButtonDown(1))
        {
            if (axisName == "Mouse X")
            {
                Debug.Log("X");
                return Input.GetAxis("Mouse X");
            }
            else if (axisName == "Mouse Y")
            {
                Debug.Log("Y");
                return Input.GetAxis("Mouse Y");
            }
        }

        return 0;
    }
}

How do I make this work with click and drag inbetween different frames?

Try putting this CinemachineCore.GetInputAxis = GetAxisCustom; in Update not start. Start only actions once.

public void Update()
     {
         CinemachineCore.GetInputAxis = GetAxisCustom;
     }