Please have a try with this one:
CREATE PROCEDURE `addByType`(IN myDate DATETIME, IN myType INT, OUT output DATETIME)
BEGIN
CASE
WHEN myType = 1 THEN
SET @unit = 'HOUR';
WHEN myType = 2 THEN
SET @unit = 'DAY';
END CASE;
SET @sql = CONCAT('SELECT TIMESTAMPADD(', @unit, ', 1, \'', myDate, '\') INTO @output;');
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET output = @output;
END
May include syntax errors, would have to look up certain things. But I'm sure you can figure it out. Gotta go now, will have a look again tomorrow.