I'd amend this to whatever number of hours you need. For some people that's 10 for others 5. Beyond that this is very very true. Tiredness makes everything more stressful and difficult and suppressed creative thought (which good programming needs).
Yes!! Sleep is the bedrock of your life. Without sleep you are more stressed, eat worse, exercise less, and are less intelligent. It's not about some macho ability to go on less sleep. You're just a high functioning, chronically sleep deprived human. You have the performance of a drunk person, but you don't even get to enjoy fun drunken conversations. Sleep deprivation is insane.
P.S. I am saying this as I bring on another all nighter, doing work I don't really enjoy. ;) I bought a Mi Band to track my sleep, though! I highly recommend it. If you measure it, it will improve.
For me, I can usually get myself going by putting on some good music, then making a list of a few things I need to accomplish today, and doing the easiest/fastest one first.
Life is too short.
I'd spend a week with full rest, clean food and water, determine your happiness level there, then decide. Sounds like you are trying to mask the core/root of the problem, a bad environment for you.
find some issue that is wasting users time, either internal or external. Fix it as a side project and create some value with this project. Then let people know about it.
Get a good solid 8 hours of sleep. Sometimes a lack of motivation is is simply fatigue. It makes my work day drastically different.
Don't try and cheat it either by sleeping less using caffeine to feel awake.