Help to increase/decrease brightness via mouse scroll on top left corner

Hi,
I want to increase/decrease brightness via magic mouse scroll on top left corner. I use two triggers for that, first i toggle the modifier key (command) up and down when I move mouse to/move mouse away from left corner and then I assign a modifier plus scroll action to brightness. First trigger works, I can confirm command key is down when on left corner but second trigger (command plus scroll) never works. Any idea why?

the problem is that BTT simulates the standard brightness keys to change the brightness.
However these don't work while cmd is pressed.

You could use the "Run Real Java Script" action


async function increaseBrightness() {
    let currentBrightness = await get_number_variable("BuiltInDisplayBrightness")
     await set_number_variable({variableName: "BuiltInDisplayBrightness", to: currentBrightness + 0.1});
}
async function decreaseBrightness() {
    let currentBrightness = await get_number_variable("BuiltInDisplayBrightness")
     await set_number_variable({variableName: "BuiltInDisplayBrightness", to: currentBrightness - 0.1});
}

Thanks for the fast and detailed answer.

Unfortunately it still doesn't work. The JS code works when I run java script and increases brightness up/down but it doesn't work when combined with move mouse to top left corner command key down action.