MZ How do I refresh other windows in the same Scene

I have 2 windows: Window_EquipmentWeapon and Window_WeaponSlot in the same scene: Scene_Equipment.
How do i make something like this, when
Window_EquipmentWeapon.prototype.processOk function run, I want to refresh the Window_WeaponSlot too?

JavaScript:
Scene_Equipment.prototype.create = function() {
    Scene_MenuBase.prototype.create.call(this);
    
    const rect = new Rectangle(333,333,500,500);
    this._windowEquipment = new Window_EquipmentWeapon(rect);
    this.addWindow(this._windowEquipment)
    this._windowEquipment.activate();
    this._windowEquipment.setHandler("ok", this.command1.bind(this));

    const rect2 = new Rectangle(111,111,110,110)
    this._weaponSlot = new Window_WeaponSlot(rect2);
    this.addWindow(this._weaponSlot);
    this._weaponSlot.activate();
}

Window_EquipmentWeapon.prototype.initialize = function (rect) {
    Window_Selectable.prototype.initialize.call(this, rect);
    this.refresh();
}

Window_EquipmentWeapon.prototype.drawItem = function (index) {
    var itemRect = this.itemRect(index); 
        if (!isNaN(index)&&index<=$gameParty.weapons().length-1)
        {
                let weapon = []
                weapon[index] = ImageManager.loadPicture('equip/'+$gameParty.weapons()[index].meta.icon);
                weapon[index].addLoadListener(() => {
                    this.contents.blt(weapon[index], 0, 0, 50, 50, itemRect.x - 4, itemRect.y);                   
                })
                          
        }
}

Window_EquipmentWeapon.prototype.processOk = function() {
    this.callOkHandler();
    console.log(this._index);
    $gameParty.members()[AzIndex].changeEquip(0, $dataWeapons[$gameParty.weapons()[this._index].id]);
    this.refresh();
};

Window_WeaponSlot.prototype.initialize = function (rect) {
    Window_Selectable.prototype.initialize.call(this, rect);
    if ($gameParty.members()[AzIndex]._equips[0]._itemId != 0)
    {
        this.addChildAt(new Sprite(ImageManager.loadPicture('equip/'+$dataWeapons[$gameParty.members()[AzIndex]._equips[0]._itemId].meta.icon)), 4)
    }
    this.refresh();
}
The usual method is to bind the windowSlot object from the Scene to an object in the windowEquipmentWeapon object itself, and then call refresh on that object. So you'd need to add a function to a few stuff. I'm adding a new function, and modifying 2 existing ones:

Code:
// New function entirely
Window_EquipmentWeapon.prototype.setWindowWeaponSlot = function(win) {
    this._winWeaponSlot = win;
};

Window_EquipmentWeapon.prototype.processOk = function() {
    this.callOkHandler();
    console.log(this._index);
    $gameParty.members()[AzIndex].changeEquip(0, $dataWeapons[$gameParty.weapons()[this._index].id]);
    this.refresh();
    // This is new
    if (this._winWeaponSlot) {
        this._winWeaponSlot.refresh();
    }
};

Scene_Equipment.prototype.create = function() {
    Scene_MenuBase.prototype.create.call(this);
    
    const rect = new Rectangle(333,333,500,500);
    this._windowEquipment = new Window_EquipmentWeapon(rect);
    this.addWindow(this._windowEquipment)
    this._windowEquipment.activate();
    this._windowEquipment.setHandler("ok", this.command1.bind(this));

    const rect2 = new Rectangle(111,111,110,110)
    this._weaponSlot = new Window_WeaponSlot(rect2);
    this.addWindow(this._weaponSlot);
    this._weaponSlot.activate();

    // This is new
    this._windowEquipment.setWindowWeaponSlot(this._weaponSlot);
};
Thank you for your answer, this part is really confusing T_T, but finally I did it.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-refresh-other-windows-in-the-same-scene.155322/