I would like to do this programmatically through the Figma Plugin API, currently, there isn’t direct support for toggling the “Fixed Position When Scrolling” property.
This is a manual setting that users must configure in Figma. The plugin API provides limited access to interact with the Figma interface and prototype settings.
And would be a huge help in creating plugins to assist in prototyping.