Don’t worry, it will definitely get better. I gave IV coke a good bashing for a long time and was into industrial level meth use for quite some time. I took a four year break from all drugs and the first several months were very hard. I had emotional problems as well as cognitive problems. It was a big deal for me because I was trying to do a university degree as part of my recovery. I just concentrated on good eating and doing meditative type activities like yoga and swimming laps (every single day). Gradually my cognitive skills improved to the point where I finished my degree and got the highest score of the cohort.
I was about 45 when this happened, and I think age plays a role in recovery. My experience was that thinking skills come back faster than memory. My memory is still pretty average and I am a little bit challenged remembering new things when I try and study. I compensated for it by getting much better at making and using notes and reminders. I also am not as confident public speaking as I used to be as I don’t seem to be able to riff off my subject knowledge as well as I used to. It’s all there when I try and write but just not as accessible on-the-fly as it was. I compensate for that by reading my presentations more and developing a slower style of speaking as well as looking thoughtful rather than confused when I’m trying to recall something specific.
So basically, if you think a bit long term you’re definitely going to get better and there are lots of things you can do to speed up recovery and manage your performance in the meantime.