How to reset counters selectively?

From: <>
Date: Sat, 30 Oct 2021 21:39:20 UTC
Hello everyone,

I'm running into this question that seems simple to me, but I can't find 
a satisfying answer, so probably it's not as simple as I think.

I'd like to selectively reset counters to zero, but only if they are 
currently not zero.

I hope you don't mind if I redirect you to the FreeBSD forums, instead 
of repeating the (short) discussion I had there, and risking the loss of 
The thread is here:

Thanks in advance for any response.