HDRI mass copy

Hi, i'm a noob to maxscript, but i need a script that let me select an hdri from my library, then change some parameters (the sames of an vrauhdrimap), and mass copy it to the environment slot of all materials in the scene, as instances of the same hdri

It is possible...somebody can help-me?