struct DATA // a struct I named as DATA
integer variable1 // an integer variable of that struct
integer variable2 // another integer variable of that struct
integer variable3 // another integer variable of that struct
endstruct // end of struct
function DarthPlagueis takes nothing returns nothing // some random function
local DATA a = DATA.create() // Here I create index for struct and assing it to "a" variable
call SetUnitUserData(<unit>,a) // Here I set units custom value to that index I created
a.variable1 = 500 // here I set first variable of struct for index I created to 500
a.varable2 = 1000
a.variable3 = 1337
endfunction // end of function
function AnotherFunc takes nothing returns nothing // another random function
local DATA b = GetUnitUserData(<unit>) // here I read the value stored inside unit and assing "b" variable to it (it may be anything you want a,b,lol,wtfboom doesnt matter)
b.variable1 = 101 // here I set first variable of that index to 101
b.variable2 = 412412
b.varaible3 = 2512
endfunction // end of function