You can't set a discrete value for duration, it's limited to short|long (7 or 25 seconds respectively).
By using
ShowToastXml this (and all other) elements can already be set. I'll expose 'duration' and 'scenario' to
ShowToastJson, but since neither of these are recommended for use
(ref) and to keep
ShowToast simple, if you want to use any custom attributes use
ShowToastXml or
ShowToastJson.