The really large improvements came from external structure and therapy. BTW I experienced pretty much the same as you did in the beginning, it was only the third therapist who asked the really uncomfortable questions and went in deep. The others were just a waste of time. The difference between good and bad therapists is several orders of magnitude and a personal connection matters. Don't give up and try to get recommendations.
I still don't see the use for these pills out of last resort party add on.
You might also have another condition like depression.
I've experimented with several chemicals (probably not legal where I live) and indeed not all provide both focus AND motivation.
Healthy work habits, enjoying the work that you do, having longer term goals and your work actually contributing to your longer term goals, having hobbies outside work and so on and on -- all these things can help.
Also make sure you lead a healthy lifestyle, you sleep properly, you do physical activity, check you vitamin Bs, hormone levels -- thyroid, testosterone.
You can also do a DNA test with 23andme/ancestry and then analyze the raw data with something like Promethease.
I don't like coffee, nor alcohol, and I never put any smoke in my mouth. When my diet is OK and my body gets the required exercise, the mind works best.
Have you ever been burned out? I wouldn't work 90 hours per week these days unless someone was paying me a really serious amount of money. For my current rates, I find it not unethical to work at a more relaxed pace, procrastinating, really maybe working for about 3 hours per day.
You might be unsure of the resulting reward from doing something. When I was an undergraduate, I've experienced poverty and hunger multiple times, which was proved to be (ironically) a great motivator. Unless off course I couldn't find a client to do a project for so I'd find myself in some serious depression instead.
I was (am?) a Matrix fan myself, but I wouldn't find it rewarding to rewatch the films or the anime again. I like re-reading the interpretations once in 2 or 3 years or so (<spoilers>I believe Neo is a program himself and Zion is also a simulation</spoilers>).
On the other hand, I binge-watched the two seasons of Stranger Things when the second one came out. Did I like it? Yes. Would I rewatch it, no. There's no reward in doing so.
I hate to give advice on the internet, as the variables that define each of us are haotic, but try to get along with yourself. Boredom might be a coping/survival mechanism of our bodies to not burn out (the reward must be greater than the energy/time you dedicated to a project).