Your example returns false here (the doc says it should return true on success). SetToggleCommandState is only for ReaScripts, to make its toolbar icon appear pressed like this: .
It doesn't work on extension actions. Use Main_OnCommand if you just want to run _SWSTL_TOGTCP or SetMediaTrackInfo_Value to set the TCP visibility of a given track.

Your example returns false here (the doc says it should return true on success). SetToggleCommandState is only for ReaScripts, to make its toolbar icon appear like this: .
It doesn't work on extension actions. Use Main_OnCommand if you just want to run _SWSTL_TOGTCP or SetMediaTrackInfo_Value to set the TCP visibility of a given track.