Not seeing a way to get the window currently under the mouse pointer, but this is pretty interesting - thanks!
You can get the positions of every windows, the position of the mouse pointer, and you can focus windows.
This is really cool, I'm gonna try and implement it!
https://www.hammerspoon.org/docs/hs.mouse.html
https://www.hammerspoon.org/docs/hs.window.html