When running plugged in, windows will apply the highest performance settings.
This can cause the cpu to overheat and slow down.
Laptop coolers are light and not so efficient.
First, see that your cooler airways are clear and that the cooler fan is spinning.
Use a windows balanced power profile, not the performance profile.
Set a minimum cpu performance to something like 20%
It is counter-intuitive, but, try changing the windows balanced power profile advanced functions to a max of 90% instead of the default of 100%
You may not notice the reduced cpu performance.