I have taps for all of these sizes so can freshen the threads.
Me too. I also have a couple of different style screw pitch gauges to check.
One is a metal plate with different sized threaded holes. You test fit the screw to identify it.
And the other has an assortment of blades with varying teeth. You match the teeth against the threads to get the thread count. I normally use the plate.
I cannot tell a 4-36 from a 4-40 just by eye any longer.