How can a Stylistic Set be substituted in a variable font?

I am a decent programmer, but really no nothing about the feature programming language.

For Stylistic Sets ss01, ss02, etc.

It is possible to start by defining a Master of name Style and four letter code STYL", with numbers 1, 2, etc. controlling substitution of the Stylistic Sets ss01, ss02, etc.

It is possible to paste the Stylistic Sets into bracket layers in all the masters and layers that would control substitution, but that is too much work for all the layers and Glyphs.

It is possible to use conditional feature code per the manual:

#ifdef VARIABLE
condition 1 < STYL < 2;
sub a by a.ss01;
etc. (These subs would be copied from the automatically generated ss01 feature)
#endif

#ifdef VARIABLE
condition 2 < STYL < 3;
sub a by a.ss02;
etc. (These subs would be copied from the automatically generated ss02 feature)
#endif

Etc.

Can multiple statements like above all go in one feature, or do they need to be in separate features.

Can they go at the end of the ss01, ss02, etc, features. This could be convenient. After stylistic set features are updated and prior to export, auto generation would be turned off, and the subs would be copied as indicated above and at the end of each of the stylistic sets feature code.

What is a good place to put the code?

Any suggestions on how best to do this would be appreciated - Thanks.

What exactly are you trying to Do you like the a glyphs by sliding a slider?

Yes, to have the glyphs of a stylistic set substituted using a slider in a variable font, like the substitution of an italic variant set being done by a slider in a variable font.

Then write a feature conditions as you write already. You can have more than one conditions in one block.