How to suspend then hibernate when closing the lid of my laptop?

Hello, I would like to have my laptop suspend to RAM when I close the lid then hibernate after a set amount of time. I'm using Ubuntu Mate 18.04.
I followed these guidelines --> https://askubuntu.com/a/781957, but it doesn't work. My guess is that mate-power-manager does its own thing when it comes to suspending the computer. Thing is, in mate-power-preferences, suspend-then-hibernate isn't an option, neither is it in dconf at /org/mate/power-manager/button-lid-battery.

So is it possible to do?

You didnt give a lot of details. Did you check the basic stuff like your swap partition being larger than RAM in the machine (eg: if PC has 8GB RAM, have a 10GB SWAP partition)?

My swap partition is 8GB, the same as the amount of RAM I have. I don't think it's the problem because I can hibernate, and suspend then hibernate do work when I run sudo systemctl suspend-then-hibernate.
When I say it doesn't work I mean that uncommenting the line #HandleLidSwitch=suspend in /etc/systemd/logind.conf and replacing suspend by suspend-then-hibernate doesn't change the behavior. If I select suspend in mate-power-preferences, the computer still suspends, and if I select hibernate, it still hibernates.

hmm strange, Im not sure hopefully someone else knows then.