How to disable comments based on some conditions?

Hi!

Is there a better way to disable comments then “document.querySelectorAll(”.form-comments")[0].style.display=“none”;" ?

I want to disable comments when doctype is in some workflow state

Following this post, I want to disable comments, New Email and New Event for a specific Lead based on some conditions