How to reference an EditorWindow script in a MonoBehaviour script OR how to pass variables from a EditorWindow to a MonoBehaviour script?

Hello, I am right now trying to build an EditorWindow from which I can activate my boosters, it works very simple, if I click the button on the EditorWindow the bool gets set too true.
Now I want to pass the bool variable to my playerMovement script, a MonoBehaviour script normally I would just reference the script where I set the bool variable, but I can not attach the editor window script to the playerMovement script, after some time googling I saw that you can’t reference an EditorWindow script inside a MonoBehaviour script.
So how I do pass a bool variable from the EditorWindow to the PlayerMovement script?

My EditorWindow looks like this:

public bool speedBooster;
    
        [MenuItem("My Windows/BoosterWindow")]
        static void Init()
        {
            boosterWindow window = (boosterWindow)EditorWindow.GetWindow(typeof(boosterWindow));
            window.Show();
        }
    
        void OnGUI()
        {
            GUILayout.Label("Active the boosters from the buttons below");
    
            if (GUILayout.Button("SpeedBooster"))
            {
                speedBooster = true;
            }
        }

And my playerMovement will use the variable like this:

public class PlayerMovement : MonoBehaviour
{
 public boosterWindow bw;
   
    private void Update()
    {
        if (bw.speedBooster)
        {
            boosting = true;
            speed -= 5;
        }
    }
}

Can anybody suggest me an idea of how I can tell the playerMovement script that the bool is true so that the speed variable gets changed?

Dont reference Editor windows in monobehaviour its the wrong way around.

It looks like you do not want an Editor Window though. just an Editor.

an Editor class has a target property (the monobehaviour).

usage:

[CustomEditor(typeof(PlayerMovement))]
public class PlayerMovementEditor : Editor {
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        if (GUILayout.Button("boost player"))
        {
            Debug.Log((PlayerMovement)target);
            ((PlayerMovement)target).speedBooster  = true;
        }

    }

}

if you realy want/ have to to use an EditorWindow, you will have to find the target monobehaviour.
using e.g Unity - Scripting API: Transform.Find
or Unity - Scripting API: Selection.gameObjects
or many other ways.