Here is the script updated for 4.0.
https://drive.google.com/file/d/1bSHc8KzHAFVbt3i3bbr1twNMP0IZoMvx/view?usp=sharing
All I did was change the Props a little.
From: row.prop(context.active_object.data, “layers”, index=16, toggle=True, text=”Root”)
To: row.prop(context.active_object.data.collections[“Layer 17”], “is_visible”, toggle=True, text=”Root”)
instead of using index you use the collections name. I could have use Root, Squash, Body, and Spin. Warp is divided to Warp_01 and Warp_02. I’m not sure if those bone collections will carry over in the stable release, but the Layer # is the defined method set by the devs.