How to refresh related action button in record

My requirement is to refresh my related action button when any event happens and the visibility for the related action set to false

  Discussion posts and replies are publicly visible