Need Help with Actor Speed and Timers

Hello,
I'm making a game that when the actor, Ball, collides with particular objects, its speed will either decrease or increase for a certain amount of time, and then go back to its original speed. I thought I understood the logic of how to get this to work, but apparently not, it's driving me insane.
I have it in a Rule so that when Ball collides with actors of type Slow, use a timer that for 3 seconds, it slows down to 150, and a second timer, so that after 3 seconds, speed goes back up to 250. Same for Fast, but for 3 seconds, the speed would be 350 instead of 150.
I've tried a variety of things. I've tried making a global real attribute "Speed" with a value of 250 and applying that to Ball, and changing the attribute whenever it collides with either Slow or Fast. However, Ball won't even move if I do that, so I don't even know if it works if it collides with Fast or Slow.
I've also tried using Max Speed, and altering self.MaxSpeed when it collides. With Slow, Ball does slow down, but once the timer is over, it won't speed back up like I specify with the second timer. With Fast, it won't even speed up at all. I've tried it with only the first timer as well (since it should only apply for the amount of time since I'm using "for" in the timer), but it doesn't work either.
It's driving me crazy. Does anyone have a clue how to get this to work? Thanks!
I'm making a game that when the actor, Ball, collides with particular objects, its speed will either decrease or increase for a certain amount of time, and then go back to its original speed. I thought I understood the logic of how to get this to work, but apparently not, it's driving me insane.
I have it in a Rule so that when Ball collides with actors of type Slow, use a timer that for 3 seconds, it slows down to 150, and a second timer, so that after 3 seconds, speed goes back up to 250. Same for Fast, but for 3 seconds, the speed would be 350 instead of 150.
I've tried a variety of things. I've tried making a global real attribute "Speed" with a value of 250 and applying that to Ball, and changing the attribute whenever it collides with either Slow or Fast. However, Ball won't even move if I do that, so I don't even know if it works if it collides with Fast or Slow.
I've also tried using Max Speed, and altering self.MaxSpeed when it collides. With Slow, Ball does slow down, but once the timer is over, it won't speed back up like I specify with the second timer. With Fast, it won't even speed up at all. I've tried it with only the first timer as well (since it should only apply for the amount of time since I'm using "for" in the timer), but it doesn't work either.
It's driving me crazy. Does anyone have a clue how to get this to work? Thanks!
Comments
So to recap, the Ball actor's speed isn't changing when I want it to. I have a game attribute Speed, set initially at 250. I use a Change Velocity behavior to start Ball moving, and I have the Speed in the behavior as game.Speed, which works. I have a rule that whenever Ball collides with an actor of a specific type, Change Attribute game.Speed to whatever number I want. However, Ball isn't reacting to the change of game.Speed, it just keeps going at 250.
I've put Ball's Max Speed to 0, and unchecked Apply Max Speed. I'm running GS 0.94. Is it possible that the file is corrupt? I'd say Change Attribute is broken, but it works with everything else, just not with game.Speed. Would upgrading to 0.96 possible fix this?