CPU 2 and 3 shutting off after alt tabbing from game, leaving processor stuck at .79GHz and unplayable until computer restart


Feb 2, 2018
For the past year or so I've had a longstanding issue where whenever I close or tab out of a game, my laptop is permanently stuck using only using 2 of its 4 logical processors, rendering my games almost unplayable and my computer extremely laggy until I shut it off.
My computer is an HP Envy m7 and it has an intel i7 5500 2.4 GHz and an NVIDIA GeForce 940m

All of my drivers and BIOS are up to date

I've tried overclocking my computer and forcing my processor to 100% but they still always shut off.

Is this a hardware malfunction that I can't control or is there something I can do to prevent this?