There exist a macro “Userfields” in Gimmicks in LibreOffice Macros. It starts with “StartChangesUserfields”. “Save” seems not to work, but you can enter values into a field in a dialog and press “Select” to assign them; then Exit.
The macros there have not been maintained since OpenOffice.org, but they might give you an idea about how changing the fields might work.
Why do you need that? If it is about changing the user without changing the user on operating system level but only for LibreOffice, then a call with UserInstallation might work too. E.g.
D:\Apps\LO54x\program\soffice.exe -env:UserInstallation=file:///d:/Apps/LO54x_de_user
will call a LibreOffice installation, which is located in D:\Apps\LO54x\program\soffice.exe
for a user, whose LibreOffice user profile is in folder d:/Apps/LO54x_de_user
. (All on Windows 10)