Can fapping every night ACTUALLY affect your brain and memory?

I've fallen back into a bad cycle where I basically HAVE to jerk off to some porn every night before bed and then I wake up the next day to heavy brain fog and it's hard to focus or remember certain things.

Have any of you noticed this and then stopped and noticed it improved?

Is it because of the dopamine?