Minimize a window and open it after

Hello, I would like to create an automation with bettertouchtool that minimize a window when i do swipe down with 4 finger scroll upand an other that opens the last minimized with a 4 finger scroll Down(both like in a windows laptop). There are 2 problems: in full screen i can’t minimize a window, i tried with 2 keyboard shortcuts (esc to leave the full screen and cmd M to minimize but i don’t know why it does not work) but i did not find solutions. The other problem is that there is not a possibility to reopen a minimized window, so has someone got a script that reopen last minimized window?