/Edit: Like written by Glovz, of course, if you can do your effect via a drug, it's the best way to go.
A further question: how would you set a temporary stat change for the dude?
First you have to add a timer with a global var to save the date when the temporary effect starts. In this moment you also set your wanted effect. Then you have to check the date all the time in obj_dude script (it's the best place imo) and if the actual time is < your defined time span, the effect gets reverted.
Code:
set_critter_stat(dude_obj, STAT_st, 1);
This should higher the ST stat and -1 would lower it again. As far as I can see, your main problem is how to set the timer, so I try to explain it now.
First you add a global var "GVAR_MY_FANCY_TIMER" name it how you want to.
Now if you want to save the date for the timer...
Code:
set_global_var(GVAR_MY_FANCY_TIMER, GAME_TIME_IN_DAYS + 3); // From now on, 3 days.
Now we have saved *now* + 3 days. We check if it works:
Code:
variable Check_Timer;
Check_Timer:=(global_var(GVAR_MY_FANCY_TIMER) - GAME_TIME_IN_DAYS);
display_msg("Days until fail: "+(Check_Timer));
Place this where ever you want to. Either in map script, so it's shown when you enter some location or you place it in the obj_dude script somwehre (critter_p_proc, it spams yer log then), etc.
Now let's use it somewhere (like before, critter_p_proc of obj_dude or in some map script or dialog, etc).
Code:
Check_Timer:=(global_var(GVAR_MY_FANCY_TIMER) - GAME_TIME_IN_DAYS);
If (Check_Timer <= 0) then begin
// Do stuff
end
As soon as our Check_Timer variable is <= 0, we know the time is over and in this moment you could revert the stat change. To be sure that you revert it back to the correct stat value, you could have saved it in the beginning too. I don't know how exactly it worked right now, but must be something like get_critter_stat(blabla) and put it into a global var, there it's save.
I can't say if this is the best way to do this stuff and I don't know if it's 100% shit-proof. In my Fallout 2 mod, I am using a similar mechanic for a perk in combination with Sfall and it doesn't always work. I am not yet sure why is that the case, but in every other script it worked for me (as quest timer).