The best way is to use an inverted set/get.
You created the setter/getter using CSS and a global variable to hold the current value.
For this to work, you need to first set it to a known value.
(I'm assuming you will want to do more than just know the scrollbar width)