You mean something like the Wild Die in WEG Star Wars? I think you just have to roll a separate D6 for that. I'm ignorant about the whole API thing, though, so hopefully the resident API wizards will have a better answer for you. I haven't come across any dice macros that will do it.