CPU clock speed and tdp dropping while gaming

I don't know whats happening but when I do gaming on my HP Pavilion gaming laptop, its CPU clock speed and TDP drops. I am facing a severe fps drop. I got a motherboard change, it fixed the problem for a while but now its happening again. I tried undervolting the CPU. It fixed the problem but sometimes it happens again. Can someone provide a solution.

CPU = Ryzen 5 5600H, RAM = 8 Gb, GPU = GTX 1650
CPU temp readings without undervolting = 95-96 degree C
fans are moving fine but loud.
CPU clock speed dropping from 4.2 GHz to 2.6 GHz or something while gaming and TDP is dropping from 30 something to 7 or 8.
 
Back