I don’t know, if these indices would correspond to layers 6 to 11 and you would have to verify it.
Maybe a safer approach would be to create a list with the layer names and to compare the submodule and/or the parameter names with this list. If it’s matching a name in this list, you could freeze it.