Minimal example code (using chunk parsing) to reproduce:
Code:
reaper.Undo_BeginBlock()
track_cnt = reaper.CountTracks( 0 )
reaper.InsertTrackAtIndex( track_cnt + 1, true )
track = reaper.GetTrack( 0, track_cnt )
fxid = reaper.TrackFX_AddByName( track, "reagate", false, -1 )
_, chunk = reaper.GetTrackStateChunk( track, "", false )
chunk = chunk:gsub("(WAK 0 0)", "PARM_TCP 0\n%1")
chunk_is_set = reaper.SetTrackStateChunk( track, chunk, false )
reaper.Undo_EndBlock( "test tcp param", -1 )
In the "Envelopes for track x" the UI button is checked for the parameter, but it does not appear on the TCP.