Potentially toxic metals pollution in the Straits of Malacca warrants the development of rapid, simple and sensitive assays. Enzyme-based assays are excellent preliminary screening tools with near real-time potential. The heavy-metal assay based on the protease ficin was optimized for mercury detection using response surface methodology. The inhibitive assay is based on ficin action on the substrate casein and residual casein is determined using the Coomassie dye-binding assay. Toxic metals strongly inhibit this hydrolysis. A central composite design (CCD) was utilized to optimize the detection of toxic metals. The results show a marked improvement for the concentration causing 50% inhibition (IC50) for mercury, silver and copper. Compared to one-factor-at-a-time (OFAT) optimization, RSM gave an improvement of IC50 (mg/L) from 0.060 (95% CI, 0.030-0.080) to 0.017 (95% CI, 0.016-0.019), from 0.098 (95% CI, 0.077-0.127) to 0.028 (95% CI, 0.022-0.037) and from 0.040 (95% CI, 0.035-0.045) to 0.023 (95% CI, 0.020-0.027), for mercury, silver and copper, respectively. A near-real time monitoring of mercury concentration in the Straits of Malacca at one location in Port Klang was carried out over a 4 h interval for a total of 24 h and validated by instrumental analysis, with the result revealing an absence of mercury pollution in the sampling site.