How do I create a custom variable in a widget whose value can be bound to a function, like default widget values?

I mean this type of binding that you can find, for instance, in a progress bar:
image

I found that to create this Bind menu I need to declare a respective delegate, like if my variable is float Percent; I declare FGetFloat PercentDelegate; and the Bind option will appear.

But how do I further retrieve the value from the bound function and set it to my custom variable?

Thank you!

So I’ve found one way to do that.
I call SetPercent(PercentDelegate.Execute()); under NativeTick().
I get that any such binding works on tick anyway, and this option should be the same performance-wise; however, I wonder is there’s another way to use this delegate without calling Execute() on tick.

Not sure what you are trying to achieve, but usually if I need some variables to impact widget in editor, I use them in preconstruct event, which works similar to Construction script in BP.
ie let’s say I want to lerp the tint of the progress bar with Percent as the alpha - if you change the tint in Preconstruct event you will see the tint changing when changing Percent value.

But again, not sure if that’s what you are looking for?

Let’s say I have a weapon that has a condition, which goes from 0 to 1.
The condition value may decrease depending on weapon usage, and there’s a progress bar that shows this condition at all times.
The default progress bar (as well as a lot of default widget components) allows this binding: it means that it will monitor a certain value (through a bound function), and show in on the progress bar.
I want to know the correct way to create these bindings for my custom variables, because I’m not using the default progress bar, but a custom widget I’ve created instead.