Update window decorations from a function

I wrote a very simple function to keep some of my windows in the top layer:

# Function: ToggleAlwaysOnTop
#
# Toggle always on top.
DestroyFunc ToggleStaysOnTop
AddToFunc ToggleStaysOnTop
+ I ThisWindow (Layer 6) WindowStyle StaysPut
+ I ThisWindow (Layer 4) WindowStyle StaysOnTop
+ I UpdateStyles
+ I Raise

This function seems to do the job. The problem is that I also have a button decoration on my windows, which depends on whether the window is on the top layer. This decoration is defined as:

+ AddButtonStyle 6 (Vector 4 50x25@1 75x75@0 25x75@0 50x25@1)
+ ButtonStyle 6 - MwmDecorLayer 6

When I trigger ToggleStaysOnTop by clicking this button, the decoration correctly changes shape, but when I call the function from a keyboard binding the decoration does not change. It changes correctly only when I unfocus the window, or do any other action that may modify the other styles of the window, like making it sticky.

From this I concluded that there must be a function to update the decorations from within my ToggleStaysOnTop function, but I could not find anything. Is there any such function? If not, is there any other method that would allow me to achieve this?

Thank you in advance.

FVWM version:
fvwm3 1.0.2 (released)
with support for: PNG, Shape, XShm, SM, XRandR, XRender, XFT, NLS

I discovered a solution to my problem, which is given by the UpdateDecor function. The new definition of the ToggleStaysOnTop function is the following:

DestroyFunc ToggleStaysOnTop
AddToFunc ToggleStaysOnTop
+ I ThisWindow (Layer 6) WindowStyle StaysPut
+ I ThisWindow (Layer 4) WindowStyle StaysOnTop
+ I ThisWindow UpdateStyles
+ I ThisWindow UpdateDecor
+ I Raise

Looking into the documentation, I can see that this function is deprecated, therefore this solution might not be ideal. Is there any alternative to this?