Why are you assuming a 5 dB decrease in effectiveness? The fact that the measure is logarithmic is just describing the measuring system of dB. It means that an increase of 10 in the system is 10x as much. So an earplug which does 20dB protection, vs. 30 dB is 1/10th as good.
So if you have earplugs which do 31dB of noise reduction, then just subtract that number from the noise level.
Personally I just use earplugs for most of my shooting unless I am at an indoor range (which I avoid). I shoot plenty of rifle and I don’t have any issues with the noise.
A 25dB NRR doesn't actually mean you subtract that from the outside noise. The recommendation is that you cut 5dB off of the NRR and apply that.
IOW, 165db - (25dB-5dB)=> 145dB exposure per shot.
That detail in the noise exposure guidelines is often missed.